********************* Church attendance (four values)***********

gen churchatt1998 = xp02
encode churchatt1998, gen(churchatt1998_1)
gen churchatt1998_2 =  churchatt1998_1
recode churchatt1998_2 (1 8 7=.) (2=1) (3=2) (4=3) (5 6=4)
gen churchatt_II1998 = churchatt1998_2
drop churchatt1998_1 churchatt1998 churchatt1998_2

gen churchatt2003 = wzp04
encode churchatt2003, gen(churchatt2003_1)
gen churchatt2003_2 =  churchatt2003_1
recode churchatt2003_2 (1 8 7=.) (2=1) (3=2) (4=3) (5 6=4)
gen churchatt_II2003 = churchatt2003_2
drop churchatt2003_2 churchatt2003_1 churchatt2003

gen churchatt2008 = vw21
encode churchatt2008, gen(churchatt2008_1)
gen churchatt2008_2 =  churchatt2008_1
recode churchatt2008_2 (1 6 7=.) (2=1) (3=2) (4=3) (5=4)
gen churchatt_II2008 = churchatt2008_2
drop churchatt2008_2 churchatt2008 churchatt2008_1

gen churchatt2013 = up09
gen churchatt2013_2 =  churchatt2013
recode churchatt2013_2 (-11 8 7 9=.) (5=4)
gen churchatt_II2013 = churchatt2013_2
drop churchatt2013_2 churchatt2013 

gen churchatt2018 = tp02
recode churchatt2018 (-11 8 7 =.) (5=4)
gen churchatt_II2018 = churchatt2018
drop churchatt2018


*************** Church has too much influence **********************************

gen churchtoomuch1998 = xm08d
recode churchtoomuch1998 (-11 98 99=.)

gen churchtoomuch2003 = wm0708m
recode churchtoomuch2003 (-11 98=.)

gen churchtoomuch2008 = vm04h
recode churchtoomuch2008 (-11 8=.)

gen churchtoomuch2013 = uc02e
recode churchtoomuch2013 (-11 -10 8 9=.)

gen churchtoomuch2018corr = tc01o
recode churchtoomuch2018corr (-11 8=.)

************** Evaluation os state-socialism *****************

gen evofsocialism1993 = yj02
recode evofsocialism1993 (-11 98 99=.)

gen evofsocialism1998 = xj03a
recode evofsocialism1998 (-11 98 99=.)

gen evofsocialism2003 = wj0103a
recode evofsocialism2003 (-11 98=.)

gen evofsocialism2008 = vj01a
recode evofsocialism2008 (-11 8=.)

gen evofsocialism2013 = ub01a
recode evofsocialism2013 (-11 8 9=.)

gen evofsocialism2018 = tc05a
recode evofsocialism2018 (-11 8=.)

************* EDUCATION ************************

*EDUCATION 1993
gen education1993_1 = educ1993
encode education1993_1, gen(education1993_2)
gen education1993_3 = education1993_2
*EDUCATION: 0=Basic vocational General secondary Post-secondary Secondary not completed Some college/BA Tertiary completed/MA/PhD Vocational secondary 1=Primary or less 
gen education1993I = education1993_3
recode education1993I (4 2 3 5 6 7 8=0) (9=.)
label variable education1993I `"0=above primary 1=Primary or less"'
drop education1993_1 education1993_2 education1993_3

*EDUCATION 1998
gen education1998_1 = educ1998
encode education1998_1, gen(education1998_2)
gen education1998_3 = education1998_2
*EDUCATION: 0=Basic vocational General secondary Post-secondary Secondary not completed Some college/BA Tertiary completed/MA/PhD Vocational secondary 1=Primary or less 
gen education1998I = education1998_3
recode education1998I (3 5 2 4 6 7 8=0) (9 10=.)
label variable education1998I `"0=above primary 1=Primary or less"'
drop education1998_1 education1998_2 education1998_3

*EDUCATION 2003
gen education2003_1 = educ2003
encode education2003_1, gen(education2003_2)
gen education2003_3 = education2003_2
*EDUCATION: 0=Basic vocational General secondary Post-secondary Primary or less Secondary not completed Vocational secondary 1=Some college/BA Tertiary completed/MA/PhD 
gen education2003I = education2003_3
recode education2003I (2/7 =0) (8=.)
label variable education2003I `"0=above primary 1=Primary or less"'
drop education2003_1 education2003_2 education2003_3

*EDUCATION 2008
gen education2008_1 = educ2008
encode education2008_1, gen(education2008_2)
gen education2008_3 = education2008_2
*EDUCATION: 0=Basic vocational General secondary Post-secondary Primary or less Secondary not completed Vocational secondary 1=Some college/BA Tertiary completed/MA/PhD 
gen education2008I = education2008_3
recode education2008I (2/8=0) (9=.)
label variable education2008I `"0=above primary 1=Primary or less"'
drop education2008_1 education2008_2 education2008_3

*EDUCATION 2013
gen education2013_1 = educ2013
encode education2013_1, gen(education2013_2)
gen education2013_3 = education2013_2
*EDUCATION: 0=Basic vocational General secondary Post-secondary Primary or less Secondary not completed Vocational secondary 1=Some college/BA Tertiary completed/MA/PhD 
gen education2013I = education2013_3
recode education2013I (2/8=0) (9=.)
label variable education2013I `"0=above primary 1=Primary or less"'
drop education2013_1 education2013_2 education2013_3

*EDUCATION 2018
gen education2018_1 = educ2018
encode education2018_1, gen(education2018_2)
gen education2018_3 = education2018_2
*EDUCATION: 0=Basic vocational General secondary Post-secondary Primary or less Secondary not completed Vocational secondary 1=Some college/BA Tertiary completed/MA/PhD 
gen education2018I = education2018_3
recode education2018I (2/8=0) (9=.)
label variable education2018I `"0=above primary 1=Primary or less"'
drop education2018_1 education2018_2 education2018_3


************ RETIRED AND UNEMPLOYED ***************
* Making variables for each wave with the following values:
* Unemployed
* On pension + rent (even if a retired person is working, they are classified as retired if they receive pension; their income is captured by household income)

* 1993 retired
gen Retir_1993 = ya28
encode Retir_1993, gen(Retir_1993_1)
recode Retir_1993_1 (1 3=.) (4=0)
drop Retir_1993
gen Retir_1993 = Retir_1993_1
recode Retir_1993 (2=1)
drop Retir_1993_1

* 1998 Retired (+ disability pension)
gen Retir_1998 = xe07a
encode Retir_1998, gen(Retir_1998_1)
recode Retir_1998_1 (1=.) (2=1) (3 4 =0)
drop Retir_1998
gen Retir_1998 = Retir_1998_1
drop Retir_1998_1

* 2003 Retired
gen Retir_2003 = wr26cpen
recode Retir_2003 (-11 98=.) (2=0) (3=1)

* 2008 Retired/on pension
gen Retir_2008 = ve08
encode Retir_2008, gen(Retir_2008_1)
drop Retir_2008
gen Retir_2008 = Retir_2008_1
drop Retir_2008_1
recode Retir_2008 (1 7=.) (2=1) (3/6 8=0)

* 2013 Retired
gen Retir_2013 = uh06_p
encode Retir_2013, gen(Retir_2013_1)
drop Retir_2013
gen Retir_2013 = Retir_2013_1
drop Retir_2013_1
recode Retir_2013 (1 177=0) (2=.) (3/176=1)

* 2018 Retired
gen Retir_2018_1 = tos01k12
gen Retir_2018 = Retir_2018_1
drop Retir_2018_1
recode Retir_2018 (-11=.)

* UNEMPLOYED *

* 1993 Unemployed
gen Unempl_1993_1 = ya02
encode Unempl_1993_1, gen(Unempl_1993)
drop Unempl_1993_1
gen Unempl_1993_1 = Unempl_1993
recode Unempl_1993_1 (1=.) (3=0)
drop Unempl_1993
gen Unempl_1993 = Unempl_1993_1 - Retir_1993
recode Unempl_1993 (-1 1 =0) (2=1)
drop Unempl_1993_1

* 1998 Unemployed
gen Unempl_1998_1 = xa02
encode Unempl_1998_1, gen(Unempl_1998)
drop Unempl_1998_1
gen Unempl_1998_1 = Unempl_1998
recode Unempl_1998_1 (1=.) (2=1) (3=0)
drop Unempl_1998
gen Unempl_1998 = Unempl_1998_1 - Retir_1998
recode Unempl_1998 (-1=0)
drop  Unempl_1998_1

* 2003 Unemployed
gen Unempl_2003_1 = wa0102
recode Unempl_2003_1 (-11=.) (2=0)
gen Unempl_2003 = Unempl_2003_1 - Retir_2003
recode Unempl_2003 (-1=0)
drop Unempl_2003_1

* 2008 Unemployed
gen Unempl_2008_1 = va01_03
recode Unempl_2008_1 (-11=.) (2=0)
gen Unempl_2008 = Unempl_2008_1 - Retir_2008
drop Unempl_2008_1
recode Unempl_2008 (-1=0)

* 2013 Unemployed
gen Unempl_2013_1 = uh014
encode Unempl_2013_1, gen(Unempl_2013)
drop Unempl_2013_1
gen Unempl_2013_1 = Unempl_2013
recode Unempl_2013_1 (1 4 5=.) (2=0) (3=1)
drop Unempl_2013
gen Unempl_2013 = Unempl_2013_1 - Retir_2013
recode Unempl_2013 (-1=0)
drop Unempl_2013_1

* 2018 Unemployed (was a mistake - should be tos01k10)
gen Unempl_2018_1 = tos01k10
recode Unempl_2018_1 (-11=.) 
gen Unempl_2018 = Unempl_2018_1 - Retir_2018
recode Unempl_2018 (-1=0)
drop Unempl_2018_1

*********** PLACE OF RESIDENCE **************

*Place of living 1993: 5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000
gen sizecommu1993_1 = size1993
encode sizecommu1993_1, gen(sizecommu1993_2)
gen sizecommu1993_3 = sizecommu1993_2
recode sizecommu1993_3 (1=5) (5=1) (2=4) (4=2) (6=.)
gen sizecommu1993 = sizecommu1993_3
label variable sizecommu1993 `"5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000"'
drop sizecommu1993_1 sizecommu1993_3 sizecommu1993_2

*Place of living 1998: 5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000
gen sizecommu1998_1 = size1998
encode sizecommu1998_1, gen(sizecommu1998_2)
gen sizecommu1998_3 = sizecommu1998_2
recode sizecommu1998_3 (1=5) (5=1) (2=4) (4=2) (6=.)
gen sizecommu1998 = sizecommu1998_3
label variable sizecommu1998 `"5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000"'
drop sizecommu1998_1 sizecommu1998_3 sizecommu1998_2

*Place of living 2003: 5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000
gen sizecommu2003_1 = size2003
encode sizecommu2003_1, gen(sizecommu2003_2)
gen sizecommu2003_3 = sizecommu2003_2
recode sizecommu2003_3 (1=5) (5=1) (2=4) (4=2) (6=.)
gen sizecommu2003 = sizecommu2003_3
label variable sizecommu2003 `"5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000"'
drop sizecommu2003_1 sizecommu2003_3 sizecommu2003_2

*Place of living 2008: 5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000
gen sizecommu2008_1 = size2008
encode sizecommu2008_1, gen(sizecommu2008_2)
gen sizecommu2008_3 = sizecommu2008_2
recode sizecommu2008_3 (1=5) (5=1) (2=4) (4=2) (6=.)
gen sizecommu2008 = sizecommu2008_3
label variable sizecommu2008 `"5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000"'
drop sizecommu2008_1 sizecommu2008_3 sizecommu2008_2

*Place of living 2013: 5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000
gen sizecommu2013_1 = size2013
encode sizecommu2013_1, gen(sizecommu2013_2)
gen sizecommu2013_3 = sizecommu2013_2
recode sizecommu2013_3 (1=5) (5=1) (2=4) (4=2) (6=.)
gen sizecommu2013 = sizecommu2013_3
label variable sizecommu2013 `"5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000"'
drop sizecommu2013_1 sizecommu2013_3 sizecommu2013_2

*Place of living 2018: 5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000
gen sizecommu2018_1 = size2018
encode sizecommu2018_1, gen(sizecommu2018_2)
gen sizecommu2018_3 = sizecommu2018_2
recode sizecommu2018_3 (1=5) (5=1) (2=4) (4=2) (6=.)
gen sizecommu2018 = sizecommu2018_3
label variable sizecommu2018 `"5=rural, 4=below 20 000, 3=20 000-99 999, 2=100 000-499 999, 1=over 500 000"'
drop sizecommu2018_1 sizecommu2018_3 sizecommu2018_2

*********** OPINION ABOUT THE EU **********
gen eusupp1998 = xm10
gen eusupp1998_1 =  eusupp1998
recode eusupp1998_1 (2=3) (98=2) (99 -11=.)
drop  eusupp1998
rename eusupp1998_1 eusupp1998

gen eufutev2003 = wm11a
recode eufutev2003 (-11 98=.) (2=3) (3=2) 

gen eusupp2008 = vm05
recode eusupp2008 (-11 8=.) (2=3) (3=2)

gen eusuppgen2013 = ue02
recode eusuppgen2013 (-11 -10 88 99=.) (0=10) (1=9) (2=8) (3=7) (4=6) (5=5) (6=4) (7=3) (8=2) (9=1) (10=0)

gen eusuppgen2018 = te04
recode eusuppgen2018 (-11 98=.) (0=10) (1=9) (2=8) (3=7) (4=6) (6=4) (7=3) (8=2) (9=1) (10=0)

********* CONFLICTS: RULING ELITE AND THE REST **************
*Conflicts: ruling elite and the rest 1993
gen conflelrest1993 = yf01f
replace conflelrest1993="99" if conflelrest1993=="NA"
encode conflelrest1993, gen(conflelrest1993_1)
decode conflelrest1993_1, gen(conflelrest1993_2)
destring conflelrest1993_2, gen(conflelrest1993_3)
recode conflelrest1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop conflelrest1993 conflelrest1993_1 conflelrest1993_2
rename conflelrest1993_3 conflelrest1993
label variable conflelrest1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'
 
*Conflicts: ruling elite and the rest 1998
gen conflelrest1998 = xg03f
recode conflelrest1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable conflelrest1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: those in power vs. others 2003
gen conflelrest2003 = wg0304f
recode conflelrest2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable conflelrest2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: those in power vs. others 2008
gen conflelrest2008 = vg03f
recode conflelrest2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable conflelrest2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: those in power vs. others 2013
gen conflelrest2013 = ua01f
recode conflelrest2013 (-11 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable conflelrest2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: those in power vs. others 2018
gen conflelrest2018 = tb01f
recode conflelrest2018 (-11 8  =.) (1=4) (2=3) (3=2) (4=1)
label variable conflelrest2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

*********** ELECTIONS NOT NECESSARY IF THE LEADER IS GOOD **********
*Elections are not necessary if the leader is good 1998
gen electnotnec1998 = xm07i
recode electnotnec1998 (-11 98 99=.) (1=5) (5=1) (2=4) (4=2)
label variable electnotnec1998 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Elections are not necessary if the leader is good 2003
gen electnotnec2003 = wm0708i
recode electnotnec2003 (-11 98 =.) (1=5) (5=1) (2=4) (4=2)
label variable electnotnec2003 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Elections are not necessary if the leader is good 2008
gen electnotnec2008 = vm04e
recode electnotnec2008 (-11 8 =.) (1=5) (5=1) (2=4) (4=2)
label variable electnotnec2008 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Elections are not necessary if the leader is good 2013
gen electnotnec2013 = uc01i
recode electnotnec2013 (-11 -10 9 8 =.) (1=5) (5=1) (2=4) (4=2)
label variable electnotnec2013 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Elections are not necessary if the leader is good 2018
gen electnotnec2018 = tc01h
recode electnotnec2018 (-11 8 =.) (1=5) (5=1) (2=4) (4=2)
label variable electnotnec2018 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

********** MUTUAL CONCESSIONS ARE THE BEST WAY OF SOLVING A PROBLEM ***************
*Mutual concessions are the best way of solving a problem 1998
gen mutconcbest1998 = xm07d
recode mutconcbest1998 (-11 98 99=.)
label variable mutconcbest1998 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Mutual concessions are the best way of solving a problem 2003
gen mutconcbest2003 = wm0708d
recode mutconcbest2003 (-11 98=.) 
label variable mutconcbest2003 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Mutual concessions are the best way of solving a problem 2008
gen mutconcbest2008 = vm04b
recode mutconcbest2008 (-11 8=.)
label variable mutconcbest2008 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Mutual concessions are the best way of solving a problem 2013
gen mutconcbest2013 = uc02l
recode mutconcbest2013 (-11 -10 9 8=.) 
label variable mutconcbest2013 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Mutual concessions are the best way of solving a problem 2018
gen mutconcbest2018 = tc01u
recode mutconcbest2018 (-11 8=.) 
label variable mutconcbest2018 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

********* CONFLICTS: RICH AND POOR **************
*Conflicts: rich vs poor 1993
gen conflrichpoor1993 = yf01a
replace conflrichpoor1993="99" if conflrichpoor1993=="NA"
encode conflrichpoor1993, gen(conflrichpoor1993_1)
decode conflrichpoor1993_1, gen(conflrichpoor1993_2)
destring conflrichpoor1993_2, gen(conflrichpoor1993_3)
recode conflrichpoor1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop conflrichpoor1993 conflrichpoor1993_1 conflrichpoor1993_2
rename conflrichpoor1993_3 conflrichpoor1993
label variable conflrichpoor1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Conflicts: rich vs poor 1998
gen conflrichpoor1998 = xg03a
recode conflrichpoor1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable conflrichpoor1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: rich vs poor 2003
gen conflrichpoor2003 = wg0304a
recode conflrichpoor2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable conflrichpoor2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: rich vs poor 2008
gen conflrichpoor2008 = vg03a
recode conflrichpoor2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable conflrichpoor2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: rich vs poor 2013
gen conflrichpoor2013 = ua01a
recode conflrichpoor2013 (-11 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable conflrichpoor2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: rich vs poor 2018
gen conflrichpoor2018 = tb01a
recode conflrichpoor2018 (-11 8  =.) (1=4) (2=3) (3=2) (4=1)
label variable conflrichpoor2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

********* CONFLICTS: MANUAL VS NON-MANUAL WORKERS **************
*Conflicts: manual vs non-manual workers 1993
gen mannonman1993 = yf01b
replace mannonman1993="99" if mannonman1993=="NA"
encode mannonman1993, gen(mannonman1993_1)
decode mannonman1993_1, gen(mannonman1993_2)
destring mannonman1993_2, gen(mannonman1993_3)
recode mannonman1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop mannonman1993 mannonman1993_1 mannonman1993_2
rename mannonman1993_3 mannonman1993
label variable mannonman1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Conflicts: manual vs non-manual workers 1998
gen mannonman1998 = xg03b
recode mannonman1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable mannonman1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: manual vs non-manual workers 2003
gen mannonman2003 = wg0304b
recode mannonman2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable mannonman2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: manual vs non-manual workersr 2008
gen mannonman2008 = vg03b
recode mannonman2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable mannonman2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: manual vs non-manual workers 2013
gen mannonman2013 = ua01b
recode mannonman2013 (-11 -10 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable mannonman2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: manual vs non-manual workers 2018
gen mannonman2018 = tb01b
recode mannonman2018 (-11 8 -10 =.) (1=4) (2=3) (3=2) (4=1)
label variable mannonman2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

********* CONFLICTS: MANAGERS AND SUPERVISEES **************
*Conflicts: managers vs supervisees 1993
gen mansuper1993 = yf01c
replace mansuper1993="99" if mansuper1993=="NA"
encode mansuper1993, gen(mansuper1993_1)
decode mansuper1993_1, gen(mansuper1993_2)
destring mansuper1993_2, gen(mansuper1993_3)
recode mansuper1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop mansuper1993 mansuper1993_1 mansuper1993_2
rename mansuper1993_3 mansuper1993
label variable mansuper1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Conflicts: managers vs supervisees 1998
gen mansuper1998 = xg03c
recode mansuper1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable mansuper1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: managers vs supervisees 2003
gen mansuper2003 = wg0304c
recode mansuper2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable mansuper2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: managers vs supervisees 2008
gen mansuper2008 = vg03c
recode mansuper2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable mansuper2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: managers vs supervisees 2013
gen mansuper2013 = ua01c
recode mansuper2013 (-11 -10 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable mansuper2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: managers vs supervisees 2018
gen mansuper2018 = tb01c
recode mansuper2018 (-11 8 -10 =.) (1=4) (2=3) (3=2) (4=1)
label variable mansuper2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

********* CONFLICTS: CITY DWELLERS AND COUNTRY PEOPLE **************
*Conflicts:  city dwellers and country people 1993
gen concitvill1993 = yf01d
replace concitvill1993="99" if concitvill1993=="NA"
encode concitvill1993, gen(concitvill1993_1)
decode concitvill1993_1, gen(concitvill1993_2)
destring concitvill1993_2, gen(concitvill1993_3)
recode concitvill1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop concitvill1993 concitvill1993_1 concitvill1993_2
rename concitvill1993_3 concitvill1993
label variable concitvill1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Conflicts:  city dwellers and country people 1998
gen concitvill1998 = xg03d
recode concitvill1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable concitvill1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts:  city dwellers and country people 2003
gen concitvill2003 = wg0304d
recode concitvill2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable concitvill2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts:  city dwellers and country people 2008
gen concitvill2008 = vg03d
recode concitvill2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable concitvill2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts:  city dwellers and country people 2013
gen concitvill2013 = ua01d
recode concitvill2013 (-11 -10 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable concitvill2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts:  city dwellers and country people 2018
gen concitvill2018 = tb01d
recode concitvill2018 (-11 8 -10 =.) (1=4) (2=3) (3=2) (4=1)
label variable concitvill2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

********* CONFLICTS: BELIEVERS AND NONBELIEVERS **************
*Conflicts:  believers and nonbelievers 1993
gen conbelnonbel1993 = yf01e
replace conbelnonbel1993="99" if conbelnonbel1993=="NA"
encode conbelnonbel1993, gen(conbelnonbel1993_1)
decode conbelnonbel1993_1, gen(conbelnonbel1993_2)
destring conbelnonbel1993_2, gen(conbelnonbel1993_3)
recode conbelnonbel1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop conbelnonbel1993 conbelnonbel1993_1 conbelnonbel1993_2
rename conbelnonbel1993_3 conbelnonbel1993
label variable conbelnonbel1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Conflicts: believers and nonbelievers 1998
gen conbelnonbel1998 = xg03e
recode conbelnonbel1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable conbelnonbel1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: believers and nonbelievers 2003
gen conbelnonbel2003 = wg0304e
recode conbelnonbel2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable conbelnonbel2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: believers and nonbelievers 2008
gen conbelnonbel2008 = vg03e
recode conbelnonbel2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable conbelnonbel2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: believers and nonbelievers 2013
gen conbelnonbel2013 = ua01e
recode conbelnonbel2013 (-11 -10 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable conbelnonbel2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: believers and nonbelievers 2018
gen conbelnonbel2018 = tb01e
recode conbelnonbel2018 (-11 8 -10 =.) (1=4) (2=3) (3=2) (4=1)
label variable conbelnonbel2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

********* CONFLICTS: FIRM OWNERS AND EMPLOYEES **************
*Conflicts: firm owners and employees 1993
gen confownempl1993 = yf01g
replace confownempl1993="99" if confownempl1993=="NA"
encode confownempl1993, gen(confownempl1993_1)
decode confownempl1993_1, gen(confownempl1993_2)
destring confownempl1993_2, gen(confownempl1993_3)
recode confownempl1993_3 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
drop confownempl1993 confownempl1993_1 confownempl1993_2
rename confownempl1993_3 confownempl1993
label variable confownempl1993 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Conflicts: firm owners and employees 1998
gen confownempl1998 = xg03g
recode confownempl1998 (-11 98 99=.) (1=4) (2=3) (3=2) (4=1)
label variable confownempl1998 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: firm owners and employees 2003
gen confownempl2003 = wg0304g
recode confownempl2003 (-11 98 =.) (1=4) (2=3) (3=2) (4=1)
label variable confownempl2003 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: firm owners and employees 2008
gen confownempl2008 = vg03g
recode confownempl2008 (-11 8 =.) (1=4) (2=3) (3=2) (4=1)
label variable confownempl2008 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: firm owners and employees 2013
gen confownempl2013 = ua01g
recode confownempl2013 (-11 -10 8 9 =.) (1=4) (2=3) (3=2) (4=1)
label variable confownempl2013 `"1=No conflicts,2=Rather weak,3=Strong,4=Very strong"'

*Sources of conflicts: firm owners and employees 2018
gen confownempl2018 = tb01g
recode confownempl2018 (-11 8 -10 =.) (1=4) (2=3) (3=2) (4=1)
label variable confownempl2018 `"1=No conflicts,2=Rather weak,3==Strong,4=Very strong"'

********* The state should provide jobs for everyone who wants to work **************
*The state should provide jobs for everyone who wants to work 1993
gen stprovjobs1993 = ym05zg
replace stprovjobs1993="99" if stprovjobs1993=="NA"
encode stprovjobs1993, gen(stprovjobs1993_1)
decode stprovjobs1993_1, gen(stprovjobs1993_2)
destring stprovjobs1993_2, gen(stprovjobs1993_3)
recode stprovjobs1993_3 (-11 -10 98 99=.) (1=5) (2=4) (4=2) (5=1)
drop stprovjobs1993 stprovjobs1993_1 stprovjobs1993_2
rename stprovjobs1993_3 stprovjobs1993
label variable stprovjobs1993 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should provide jobs for everyone who wants to work 1998
gen stprovjobs1998 = xm06h
recode stprovjobs1998 (-11 98 99  =.) (1=5) (2=4) (4=2) (5=1)
label variable stprovjobs1998 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should provide jobs for everyone who wants to work 2003
gen stprovjobs2003 = wm06h
recode stprovjobs2003 (-11 98   =.) (1=5) (2=4) (4=2) (5=1)
label variable stprovjobs2003 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should provide jobs for everyone who wants to work 2008
gen stprovjobs2008 = vm03h
recode stprovjobs2008 (-11 8   =.) (1=5) (2=4) (4=2) (5=1)
label variable stprovjobs2008 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should provide jobs for everyone who wants to work 2013
gen stprovjobs2013 = uc02a
recode stprovjobs2013 (-11 -10 8 9   =.) (1=5) (2=4) (4=2) (5=1)
label variable stprovjobs2013 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should provide jobs for everyone who wants to work 2018
gen stprovjobs2018 = tc01k
recode stprovjobs2018 (-11  8  =.) (1=5) (2=4) (4=2) (5=1)
label variable stprovjobs2018 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

********* The state is responsible for reducing differences in people's incomes **************
*The state is responsible for reducing differences in people's incomes 1993
gen stredincome1993 = ym05zf
replace stredincome1993="99" if stredincome1993=="NA"
encode stredincome1993, gen(stredincome1993_1)
decode stredincome1993_1, gen(stredincome1993_2)
destring stredincome1993_2, gen(stredincome1993_3)
recode stredincome1993_3 (-11 -10 98 99=.) (1=5) (2=4) (4=2) (5=1)
drop stredincome1993 stredincome1993_1 stredincome1993_2
rename stredincome1993_3 stredincome1993
label variable stredincome1993 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state is responsible for reducing differences in people's incomes 1998
gen stredincome1998 = xm06g
recode stredincome1998 (-11 98 99  =.) (1=5) (2=4) (4=2) (5=1)
label variable stredincome1998 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state is responsible for reducing differences in people's incomes 2003
gen stredincome2003 = wm06g
recode stredincome2003 (-11 98   =.) (1=5) (2=4) (4=2) (5=1)
label variable stredincome2003 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state is responsible for reducing differences in people's incomes 2008
gen stredincome2008 = vm03g
recode stredincome2008 (-11 8   =.) (1=5) (2=4) (4=2) (5=1)
label variable stredincome2008 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state is responsible for reducing differences in people's incomes 2013
gen stredincome2013 = uc01g
recode stredincome2013 (-11 -10 8 9   =.) (1=5) (2=4) (4=2) (5=1)
label variable stredincome2013 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state is responsible for reducing differences in people's incomes 2018
gen stredincome2018 = tc01g
recode stredincome2018 (-11  8  =.) (1=5) (2=4) (4=2) (5=1)
label variable stredincome2018 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

********* The state should assist children from poor families in facilitating their access to higher education **************
*The state should assist children from poor families 1993
gen stateassistch1993 = ym05ze
replace stateassistch1993="99" if stateassistch1993=="NA"
encode stateassistch1993, gen(stateassistch1993_1)
decode stateassistch1993_1, gen(stateassistch1993_2)
destring stateassistch1993_2, gen(stateassistch1993_3)
recode stateassistch1993_3 (-11 -10 98 99=.) (1=5) (2=4) (4=2) (5=1)
drop stateassistch1993 stateassistch1993_1 stateassistch1993_2
rename stateassistch1993_3 stateassistch1993
label variable stateassistch1993 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should assist children from poor families 1998
gen stateassistch1998 = xm06e
recode stateassistch1998 (-11 98 99  =.) (1=5) (2=4) (4=2) (5=1)
label variable stateassistch1998 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should assist children from poor families 2003
gen stateassistch2003 = wm06e
recode stateassistch2003 (-11 98   =.) (1=5) (2=4) (4=2) (5=1)
label variable stateassistch2003 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should assist children from poor families 2008
gen stateassistch2008 = vm03e
recode stateassistch2008 (-11 8   =.) (1=5) (2=4) (4=2) (5=1)
label variable stateassistch2008 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should assist children from poor families 2013
gen stateassistch2013 = uc01e
recode stateassistch2013 (-11 -10 8 9   =.) (1=5) (2=4) (4=2) (5=1)
label variable stateassistch2013 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*The state should assist children from poor families 2018
gen stateassistch2018 = tc01d
recode stateassistch2018 (-11  8  =.) (1=5) (2=4) (4=2) (5=1)
label variable stateassistch2018 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

********* Large differences in income are necessary to assure the prosperity of the country **************
*Large differences in income are necessary to assure the prosperity of the country 1993
gen incdiffnec1993 = ym05zc
replace incdiffnec1993="99" if incdiffnec1993=="NA"
encode incdiffnec1993, gen(incdiffnec1993_1)
decode incdiffnec1993_1, gen(incdiffnec1993_2)
destring incdiffnec1993_2, gen(incdiffnec1993_3)
recode incdiffnec1993_3 (-11 -10 98 99=.) 
drop incdiffnec1993 incdiffnec1993_1 incdiffnec1993_2
rename incdiffnec1993_3 incdiffnec1993
label variable incdiffnec1993 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Large differences in income are necessary to assure the prosperity of the country 1998
gen incdiffnec1998 = xm06c
recode incdiffnec1998 (-11 98 99  =.) 
label variable incdiffnec1998 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Large differences in income are necessary to assure the prosperity of the country 2003
gen incdiffnec2003 = wm06c
recode incdiffnec2003 (-11 98   =.) 
label variable incdiffnec2003 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Large differences in income are necessary to assure the prosperity of the country 2013
gen incdiffnec2013 = uc02j
recode incdiffnec2013 (-11 -10 8 9   =.) 
label variable incdiffnec2013 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

*Large differences in income are necessary to assure the prosperity of the country 2018
gen incdiffnec2018 = tc01s
recode incdiffnec2018 (-11  8  =.) 
label variable incdiffnec2018 `"1=Strongly agree,2=Rather agree,3=Neither agree nor disagree,4=Rather disagree,5=Strongly disagree"'

***** DEMOCRACY MEANS MINORITY YIELDS TO MAJORITY ***********

*Democracy means minority yields to majority 1998
gen minyitomaj1998 = xm07a
recode minyitomaj1998 (-11 98 99=.) (1=5) (2=4) (4=2) (5=1)
label variable minyitomaj1998 `"1=Strongly disagree,2=Somewhat disagree,3=Neither agree nor disagree,4=Somewhat agree,5=Strongly agree"'

*Democracy means minority yields to majority 2003
gen minyitomaj2003 = wm0708a
recode minyitomaj2003 (-11 98 =.) (1=5) (2=4) (4=2) (5=1)
label variable minyitomaj2003 `"1=Strongly disagree,2=Somewhat disagree,3=Neither agree nor disagree,4=Somewhat agree,5=Strongly agree"'

*Democracy means minority yields to majority 2008
gen minyitomaj2008 = vm04a
recode minyitomaj2008 (-11 8 =.) (1=5) (2=4) (4=2) (5=1)
label variable minyitomaj2008 `"1=Strongly disagree,2=Somewhat disagree,3=Neither agree nor disagree,4=Somewhat agree,5=Strongly agree"'

*Democracy means minority yields to majority 2013
gen minyitomaj2013 = uc01f
recode minyitomaj2013 (-11 -10 8 9=.) (1=5) (2=4) (4=2) (5=1)
label variable minyitomaj2013 `"1=Strongly disagree,2=Somewhat disagree,3=Neither agree nor disagree,4=Somewhat agree,5=Strongly agree"'

*Democracy means minority yields to majority 2018
gen minyitomaj2018 = tc01f
recode minyitomaj2018 (-11  8 =.) (1=5) (2=4) (4=2) (5=1)
label variable minyitomaj2018 `"1=Strongly disagree,2=Somewhat disagree,3=Neither agree nor disagree,4=Somewhat agree,5=Strongly agree"'


******* One good party makes other unnecessary ***************

*One good party makes other unnecessary 1998
gen onegoodparty1998 = xm06f
recode onegoodparty1998 (-11 98 99=.) (1=5) (2=4) (4=2) (5=1)
label variable onegoodparty1998 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*One good party makes other unnecessary 2003
gen onegoodparty2003 = wm06f
recode onegoodparty2003 (-11 98 =.) (1=5) (2=4) (4=2) (5=1)
label variable onegoodparty2003 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*One good party makes other unnecessary 2008
gen onegoodparty2008 = vm03f
recode onegoodparty2008 (-11 8 =.) (1=5) (2=4) (4=2) (5=1)
label variable onegoodparty2008 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*One good party makes other unnecessary 2013
gen onegoodparty2013 = uc01b
recode onegoodparty2013 (-11 -10 8 9 =.) (1=5) (2=4) (4=2) (5=1)
label variable onegoodparty2013 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*One good party makes other unnecessary 2018
gen onegoodparty2018 = tc01a
recode onegoodparty2018 (-11 8  =.) (1=5) (2=4) (4=2) (5=1)
label variable onegoodparty2018 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

**** Good leader does not have to obey the law *******

*Good leader does not have to obey the law 1998
gen goodleader1998 = xm07k
recode goodleader1998 (-11 98 99  =.) (1=5) (2=4) (4=2) (5=1)
label variable goodleader1998 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Good leader does not have to obey the law 2003
gen goodleader2003 = wm0708k
recode goodleader2003 (-11 98   =.) (1=5) (2=4) (4=2) (5=1)
label variable goodleader2003 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Good leader does not have to obey the law 2008
gen goodleader2008 = vm04f
recode goodleader2008 (-11 8   =.) (1=5) (2=4) (4=2) (5=1)
label variable goodleader2008 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Good leader does not have to obey the law 2013
gen goodleader2013 = uc02g
recode goodleader2013 (-11 -10 8 9   =.) (1=5) (2=4) (4=2) (5=1)
label variable goodleader2013 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'

*Good leader does not have to obey the law 2018
gen goodleader2018 = tc01p
recode goodleader2018 (-11  8  =.) (1=5) (2=4) (4=2) (5=1)
label variable goodleader2018 `"1=Strongly disagree,2=Rather disagree,3=Neither agree nor disagree,4=Rather agree,5=Strongly agree"'


************* Income per capita in a household (z-scores) **************

* Number of people in the household
gen PeopleinHH1988 = z94hsize
recode PeopleinHH1988 (-11=.)

gen PeopleinHH1993 = yr01
recode PeopleinHH1993 (-11=.)

gen PeopleinHH1998 = xr08
recode PeopleinHH1998 (-11=.)

gen PeopleinHH2003 = wr08
recode PeopleinHH2003 (-11=.)

gen PeopleinHH2008 = vr14
recode PeopleinHH2008 (-11=.)

gen PeopleinHH2013 = uk16
recode PeopleinHH2013 (-11 77 99=.)

gen PeopleinHH2018 = tk07
recode PeopleinHH2018 (-11 97=.)

* Household income
gen hhincome1988 = z103
recode hhincome1988 (-11 9998=.) 

gen hhincome1993 = yr13
replace hhincome1993="1" if hhincome1993=="NA"
encode hhincome1993, gen(hhincome1993_1)
decode hhincome1993_1, gen(hhincome1993_2)
destring hhincome1993_2, gen(hhincome1993_3)
recode hhincome1993_3 (-11 1 999998=. )
drop hhincome1993 hhincome1993_1 hhincome1993_2
rename hhincome1993_3 hhincome1993

gen hhincome1998 = xr20
replace hhincome1998="1" if hhincome1998=="NA"
encode hhincome1998, gen(hhincome1998_1)
decode hhincome1998_1, gen(hhincome1998_2)
destring hhincome1998_2, gen(hhincome1998_3)
recode hhincome1998_3 (-11 1 99998=. )
drop hhincome1998 hhincome1998_1 hhincome1998_2
rename hhincome1998_3 hhincome1998

gen hhincome2003 = wr1621
recode hhincome2003 (999998 -11=.)

gen hhincome2008 = vr22
recode hhincome2008 (99998 -11=.)

gen hhincome2013 = uk21
recode hhincome2013 (777777 -11 888888 999999=.)

gen hhincome2018 = tk21
recode hhincome2018 (-11 99997 99998=.)

* HH Income per capita
gen pchhincome1988 = hhincome1988/PeopleinHH1988
gen pchhincome1993 = hhincome1993/PeopleinHH1993
gen pchhincome1998 = hhincome1998/PeopleinHH1998
gen pchhincome2003 = hhincome2003/PeopleinHH2003
gen pchhincome2008 = hhincome2008/PeopleinHH2008
gen pchhincome2013 = hhincome2013/PeopleinHH2013
gen pchhincome2018 = hhincome2018/PeopleinHH2018

* Z scores income per capita
egen float zpchhincome1988 = std(pchhincome1988), mean(0) std(1)
egen float zpchhincome1993 = std(pchhincome1993), mean(0) std(1)
egen float zpchhincome1998 = std(pchhincome1998), mean(0) std(1)
egen float zpchhincome2003 = std(pchhincome2003), mean(0) std(1)
egen float zpchhincome2008 = std(pchhincome2008), mean(0) std(1)
egen float zpchhincome2013 = std(pchhincome2013), mean(0) std(1)
egen float zpchhincome2018 = std(pchhincome2018), mean(0) std(1)

* Differences across waves
gen zpchhincome1993_88 = zpchhincome1993 - zpchhincome1988
gen zpchhincome1998_93 = zpchhincome1998 - zpchhincome1993
gen zpchhincome2003_98 = zpchhincome2003 - zpchhincome1998
gen zpchhincome2008_03 = zpchhincome2008 - zpchhincome2003
gen zpchhincome2013_08 = zpchhincome2013 - zpchhincome2008
gen zpchhincome2018_13 = zpchhincome2018 - zpchhincome2013

********* Self-assessed social position **********
* Self-assessed social position
gen sa_socialp1988 = z32
recode sa_socialp1988 (-11 -10 98=.) (1=10) (2=9) (3=8) (4=7) (5=6) (6=5) (7=4) (8=3) (9=2) (10=1)

gen sa_socialp1993 = ym01z
encode sa_socialp1993, gen(sa_socialp1993_1)
gen sa_socialp1993_2 =  sa_socialp1993_1
recode sa_socialp1993_2 (1 2 13 14=.) (3=10) (4=1) (5=9) (6=8) (7=7) (8=6) (9=5) (10=4) (11=3) (12=2)
drop sa_socialp1993 sa_socialp1993_1
rename sa_socialp1993_2 sa_socialp1993

gen sa_socialp1998 = xm01
encode sa_socialp1998, gen(sa_socialp1998_1)
gen sa_socialp1998_2 =  sa_socialp1998_1
recode sa_socialp1998_2 (1 12 13=.) (2=10) (3=1) (4=9) (5=8) (6=7) (7=6) (8=5) (9=4) (10=3) (11=2)
drop sa_socialp1998 sa_socialp1998_1
rename sa_socialp1998_2 sa_socialp1998

gen sa_socialp2003 = wm01
recode sa_socialp2003 (-11 98=.) (1=10) (2=9) (3=8) (4=7) (5=6) (6=5) (7=4) (8=3) (9=2) (10=1)

gen sa_socialp2008 = vm01
recode sa_socialp2008 (-11 98=.) (1=10) (2=9) (3=8) (4=7) (5=6) (6=5) (7=4) (8=3) (9=2) (10=1)

gen sa_socialp2013 = ub04
recode sa_socialp2013 (-11 -10 88 99=.) (0=1) (1=2) (2=3) (3=4) (4=5) (5=6) (6=7) (7=8) (8=9) (9=10) (10=11)

gen sa_socialp2018 = td01
recode sa_socialp2018 (-11 98=.) (0=1) (1=2) (2=3) (3=4) (4=5) (5=6) (6=7) (7=8) (8=9) (9=10) (10=11)

* standardized
egen float zsa_socialp1988 = std(sa_socialp1988), mean(0) std(1)
egen float zsa_socialp1993 = std(sa_socialp1993), mean(0) std(1)
egen float zsa_socialp1998 = std(sa_socialp1998), mean(0) std(1)
egen float zsa_socialp2003 = std(sa_socialp2003), mean(0) std(1)
egen float zsa_socialp2008 = std(sa_socialp2008), mean(0) std(1)
egen float zsa_socialp2013 = std(sa_socialp2013), mean(0) std(1)
egen float zsa_socialp2018 = std(sa_socialp2018), mean(0) std(1)

* differences across waves
gen zsa_socialp1993_1988 = zsa_socialp1993 - zsa_socialp1988
gen zsa_socialp1998_1993 = zsa_socialp1998 - zsa_socialp1993
gen zsa_socialp2003_1998 = zsa_socialp2003 - zsa_socialp1998
gen zsa_socialp2008_2003 = zsa_socialp2008 - zsa_socialp2003
gen zsa_socialp2013_2008 = zsa_socialp2013 - zsa_socialp2008
gen zsa_socialp2018_2013 = zsa_socialp2018 - zsa_socialp2013

*********** GENDER **********
gen gender_0_1 = gender
recode gender_0_1 (2=0)

*********** AGE **********
gen respage1993 = age1993
replace respage1993="1" if respage1993=="NA"
encode respage1993, gen(respage1993_1)
recode respage1993_1 ( 1 =. )
decode respage1993_1, gen(respage1993_2)
destring respage1993_2, gen(respage1993_3)
drop respage1993 respage1993_1 respage1993_2
rename respage1993_3 respage1993

gen respage1998 = age1998
replace respage1998="1" if respage1998=="NA"
encode respage1998, gen(respage1998_1)
recode respage1998_1 ( 1 =. )
decode respage1998_1, gen(respage1998_2)
destring respage1998_2, gen(respage1998_3)
drop respage1998 respage1998_1 respage1998_2
rename respage1998_3 respage1998

gen respage2003 = age2003
replace respage2003="1" if respage2003=="NA"
encode respage2003, gen(respage2003_1)
recode respage2003_1 ( 1 =. )
decode respage2003_1, gen(respage2003_2)
destring respage2003_2, gen(respage2003_3)
drop respage2003 respage2003_1 respage2003_2
rename respage2003_3 respage2003

gen respage2008 = age2008
replace respage2008="1" if respage2008=="NA"
encode respage2008, gen(respage2008_1)
recode respage2008_1 ( 1 =. )
decode respage2008_1, gen(respage2008_2)
destring respage2008_2, gen(respage2008_3)
drop respage2008 respage2008_1 respage2008_2
rename respage2008_3 respage2008

gen respage2013 = age2013
replace respage2013="1" if respage2013=="NA"
encode respage2013, gen(respage2013_1)
recode respage2013_1 ( 1 =. )
decode respage2013_1, gen(respage2013_2)
destring respage2013_2, gen(respage2013_3)
drop respage2013 respage2013_1 respage2013_2
rename respage2013_3 respage2013

gen respage2018 = age2018
replace respage2018="1" if respage2018=="NA"
encode respage2018, gen(respage2018_1)
recode respage2018_1 ( 1 =. )
decode respage2018_1, gen(respage2018_2)
destring respage2018_2, gen(respage2018_3)
drop respage2018 respage2018_1 respage2018_2
rename respage2018_3 respage2018

********* VOTING AND SUPPORT ***********
*DID NOT VOTE, VOTED OR DK IF VOTED IN ELECTIONS

*Did not vote in 1991: 2=DK, 1=no vote, 0=vote
gen votedornot1991_1 = yw22
encode votedornot1991_1, gen(votedornot1991_2)
gen votedornot1991_3 = votedornot1991_2
gen votedornot1991 = votedornot1991_3
recode votedornot1991 (1 5=.) (2=1) (3=0) (4=2)
label variable votedornot1991 `"2=DK, 1=no vote, 0=vote"'
drop votedornot1991_1 votedornot1991_2 votedornot1991_3

*Did not vote in 1993: 2=DK, 1=no vote, 0=vote
gen votedornot1993el_1 = xw09
encode votedornot1993el_1, gen(votedornot1993el_2)
gen votedornot1993el_3 = votedornot1993el_2
gen votedornot1993el = votedornot1993el_3
recode votedornot1993el (1 5=.) (2=1) (3=0) (4=2)
label variable votedornot1993el `"2=DK, 1=no vote, 0=vote"'
drop votedornot1993el_1 votedornot1993el_2 votedornot1993el_3

*Did not vote in 1997: 2=DK, 1=no vote, 0=vote
gen votedornot1997_1 = xw11
encode votedornot1997_1, gen(votedornot1997_2)
gen votedornot1997_3 = votedornot1997_2
gen votedornot1997 = votedornot1997_3
recode votedornot1997 (1 5=.) (2=1) (3=0) (4=2)
label variable votedornot1997 `"2=DK, 1=no vote, 0=vote"'
drop votedornot1997_1 votedornot1997_2 votedornot1997_3

*Did not vote in 2001: 2=DK, 1=no vote, 0=vote
gen votedornot2001 = ww09
recode votedornot2001 (-11 =.) (0=1) (1=0) (98=2)
label variable votedornot2001 `"2=DK, 1=no vote, 0=vote"'

*Did not vote in 2005: 2=DK, 1=no vote, 0=vote
gen votedornot2005 = vw15
recode votedornot2005 (-11=.) (0=1) (1=0) (8=2)
label variable votedornot2005 `"2=DK, 1=no vote, 0=vote"'

*Did not vote in 2007: 2=DK, 1=no vote, 0=vote
gen votedornot2007 = vw17
recode votedornot2007 (-11=.) (0=1) (1=0) (8=2)
label variable votedornot2007 `"2=DK, 1=no vote, 0=vote"'

*Did not vote in 2011: 2=DK, 1=no vote, 0=vote
gen votedornot2011 = ue06
recode votedornot2011 (-10 -11 9=.) (0=1) (1=0) (8=2)
label variable votedornot2011 `"2=DK, 1=no vote, 0=vote"'

*Did not vote in 2015: 0=voted, 1=not voted, 2=illegible, 3=invalid ball, 4=DK/na
gen votedornot2015 = te07
recode votedornot2015 (7 -11 =.) (1=0) (2=1) (3=2) (4=3) (8=4)
label variable votedornot2015 `"0=voted, 1=not voted, 2=illegible, 3=invalid ball, 4=DK/na"'

*WOULD VOTE FOR IN 1993: Yes/No
*Would support right-wing in 1993 = 1, would vote and not support right-wing =0 DK=.
gen wouldvotein1993 = yw24
recode wouldvotein1993 (-11 99=.) (0=1) (1=0) (98=2)
label variable wouldvotein1993 `"2=DK, 1=no vote, 0=vote"'

*WOULD VOTE FOR IN 1998: Yes/No
*Would support right-wing in 1998 = 1, would vote and not support right-wing =0 DK=.
gen wouldvotein1998_1 = xw13
encode wouldvotein1998_1, gen(wouldvotein1998_2)
gen wouldvotein1998_3 = wouldvotein1998_2
gen wouldvotein1998 = wouldvotein1998_3
recode wouldvotein1998 (1 5=.) (2=1) (3=0) (4=2)
label variable wouldvotein1998 `"2=DK, 1=no vote, 0=vote"'
drop wouldvotein1998_1 wouldvotein1998_2 wouldvotein1998_3

*WOULD VOTE FOR IN 2003: Yes/No
*Would support right-wing in 2003 = 1, would vote and not support right-wing =0 DK=.
gen wouldvotein2003 = ww13
recode wouldvotein2003 (-11=.) (0=1) (1=0) (98=2)
label variable wouldvotein2003 `"2=DK, 1=no vote, 0=vote"'

*WOULD VOTE FOR IN 2008: Yes/No
*Would support right-wing in 2008 = 1, would vote and not support right-wing =0 DK=.
gen wouldvotein2008 = vw19pael
recode wouldvotein2008 (-11=.) (0=1) (1=0) (8=2)
label variable wouldvotein2008 `"2=DK, 1=no vote, 0=vote"'

*WOULD VOTE FOR IN 2013: Yes/No
*Would support right-wing in 2013 = 1, would vote and not support right-wing =0 DK=.
gen wouldvotein2013 = ue08
recode wouldvotein2013 (88 = 2) (87=1) (1/9 = 0) (-10 -11 89 99 88 77=.)
label variable wouldvotein2013 `"2=DK, 1=no vote, 0=vote"'

*WOULD VOTE FOR IN 2018: Yes/No
*Would support right-wing in 2018 = 1, would vote and not support right-wing =0 DK=.
gen wouldvotein2018_1 = te09
recode wouldvotein2018_1 (-11=.) (98=1) (1=2) (86=3) (87=4) (97=5)
rename wouldvotein2018_1 wouldvotein2018
label variable wouldvotein2018 `"1=DK/NA, 2=Yes(party name), 3=No, 4=Invalid ballot, 5=Refused"'

***** II ******
*PARLIAMENTARY ELECTIONS 1991: who voted for
*Voted for right-wing 1991 = 1, voted and not voted for right-wing=0 DK=.
gen rightvotein1991_1 = yw23
replace rightvotein1991_1="999" if rightvotein1991_1=="NA"
destring rightvotein1991_1, replace
recode rightvotein1991_1 (7 124 134 41 61 46 19 12 13 23 133 42 17 128 = 1) (-11 998 999=.)
recode rightvotein1991_1 (2/239=0)
rename rightvotein1991_1 rightvotein1991II
label variable rightvotein1991II `"Voted for right-wing 1991 = 1, voted and not voted for right-wing=0 DK=."'

*WOULD VOTE FOR IN 1993
*Would support right-wing in 1993 = 1, would vote and not support right-wing =0 DK=.
gen rightsuppin1993_1 = yw25
replace rightsuppin1993_1="999" if rightsuppin1993_1=="NA"
destring rightsuppin1993_1, replace
recode rightsuppin1993_1 (7 138 41 19 12 13 113 123 23 42 17 128 = 1) (-11 998 999=.)
recode rightsuppin1993_1 (2/239=0)
rename rightsuppin1993_1 rightsuppin1993II
label variable rightsuppin1993II `"Would support right-wing in 1993 = 1, would vote and not support right-wing =0 DK=."'

*PARLIAMENTARY ELECTIONS 1993: who voted for
*Voted for right-wing 1993 = 1, voted and not voted for right-wing=0 DK=.
gen rightvotein1993_1 = xw10
replace rightvotein1993_1="999" if rightvotein1993_1=="NA"
destring rightvotein1993_1, replace
recode rightvotein1993_1 (225 41 12 123 111 42 128 = 1) (-11 998 999=.)
recode rightvotein1993_1 (2/229=0)
rename rightvotein1993_1 rightvotein1993II
label variable rightvotein1993II `"Voted for right-wing 1993 = 1, voted and not voted for right-wing=0 DK=."'

*PARLIAMENTARY ELECTIONS 1997: who voted for
*Voted for right-wing 1997 = 1, voted and not voted for right-wing=0, DK=.
gen rightvotein1997_1 = xw12
replace rightvotein1997_1="999" if rightvotein1997_1=="NA"
destring rightvotein1997_1, replace
recode rightvotein1997_1 (225 41 12 42 128 = 1) (-11 998 999=.)
recode rightvotein1997_1 (2/239=0)
rename rightvotein1997_1 rightvotein1997II
label variable rightvotein1997II `"Voted for right-wing 1997 = 1, voted and not voted for right-wing=0, DK=."'

*WOULD VOTE FOR IN 1998
*Would support right-wing in 1998 = 1, would vote and not support right-wing =0, DK=.
gen rightsuppin1998_1 = xw14
replace rightsuppin1998_1="999" if rightsuppin1998_1=="NA"
destring rightsuppin1998_1, replace
recode rightsuppin1998_1 (225 7 41 12 123 36 42 128 = 1) (-11 998 999=.)
recode rightsuppin1998_1 (2/229=0)
rename rightsuppin1998_1 rightsuppin1998II
label variable rightsuppin1998II `"Would support right-wing in 1998 = 1, would vote and not support right-wing =0, DK=."'

*PARLIAMENTARY ELECTIONS 2001: who voted for
*Voted for right-wing 2001 = 1, voted and not voted for right-wing=0, refused to answer and DK=.
gen rightvotein2001_1 = ww10
replace rightvotein2001_1="99" if rightvotein2001_1=="NA"
destring rightvotein2001_1, replace
recode rightvotein2001_1 (12 14 53 18 22 28 36 40  = 1) (-11 98 97 99=.)
recode rightvotein2001_1 (2/96=0)
rename rightvotein2001_1 rightvotein2001II
label variable rightvotein2001II `"Voted for right-wing 2001 = 1, voted and not voted for right-wing=0, refused to answer and DK=."'

*Voted for right-wing 2001 = 1, voted and not voted for right-wing=0, refused to answer and DK=. (*PO = r-W)
gen rightvotein2001_1 = ww10
replace rightvotein2001_1="99" if rightvotein2001_1=="NA"
destring rightvotein2001_1, replace
recode rightvotein2001_1 (12 14 53 18 22 28 36 40 20 = 1) (-11 98 97 99=.)
recode rightvotein2001_1 (2/96=0)
rename rightvotein2001_1 rightvotein2001_POII
label variable rightvotein2001_POII `"Voted for right-wing 2001 = 1, voted and not voted for right-wing=0, refused to answer and DK=."'

*WOULD VOTE FOR IN 2003
*Would support right-wing in 2003 = 1, would vote and not support right-wing =0, refused to answer and DK=.
gen rightsuppin2003_1 = ww14
replace rightsuppin2003_1="99" if rightsuppin2003_1=="NA"
destring rightsuppin2003_1, replace
recode rightsuppin2003_1 (12 14 53 22 28 36 40 = 1) (-11 98 97 99=.)
recode rightsuppin2003_1 (2/96=0)
rename rightsuppin2003_1 rightsuppin2003II
label variable rightsuppin2003II `"Would support right-wing in 2003 = 1, would vote and not support right-wing =0, refused to answer and DK=."'

*Would support right-wing in 2003 = 1, would vote and not support right-wing =0, refused to answer and DK=. (*PO = r-W)
gen rightsuppin2003_1 = ww14
replace rightsuppin2003_1="99" if rightsuppin2003_1=="NA"
destring rightsuppin2003_1, replace
recode rightsuppin2003_1 (12 14 53 20 22 28 36 40 = 1) (-11 98 97 99=.)
recode rightsuppin2003_1 (2/96=0)
rename rightsuppin2003_1 rightsuppin2003_POII
label variable rightsuppin2003_POII `"Would support right-wing in 2003 = 1, would vote and not support right-wing =0, refused to answer and DK=."'

*PARLIAMENTARY ELECTIONS 2005: who voted for
*Voted for right-wing 2005 = 1, voted and not voted for right-wing=0, refused to answer and DK=.
gen rightvotein2005_1 = vw16
replace rightvotein2005_1="99" if rightvotein2005_1=="NA"
destring rightvotein2005_1, replace
recode rightvotein2005_1 (14 22 28 36 = 1) (-11 98 97 99=.)
recode rightvotein2005_1 (2/52=0)
rename rightvotein2005_1 rightvotein2005II
label variable rightvotein2005II `"Voted for right-wing 2005 = 1, voted and not voted for right-wing=0, refused to answer and DK=."'

*PARLIAMENTARY ELECTIONS 2007: who voted for
*Voted for right-wing 2007 = 1, voted and not voted for right-wing=0, refused to answer and DK=.
gen rightvotein2007_1 = vw18
replace rightvotein2007_1="99" if rightvotein2007_1=="NA"
destring rightvotein2007_1, replace
recode rightvotein2007_1 (12 14 22 19 28 36 = 1) (-11 98 97 99=.)
recode rightvotein2007_1 (2/96=0)
rename rightvotein2007_1 rightvotein2007II
label variable rightvotein2007II `"Voted for right-wing 2007 = 1, voted and not voted for right-wing=0, refused to answer and DK=."'

*WOULD VOTE FOR IN 2008
*Would support right-wing in 2008 = 1, would vote and not support right-wing =0, DK=.
gen rightsuppin2008_1 = vw19
replace rightsuppin2008_1="99" if rightsuppin2008_1=="NA"
destring rightsuppin2008_1, replace
recode rightsuppin2008_1 (14 53 22 28 36 = 1) (-11 98 97 99=.)
recode rightsuppin2008_1 (2/96=0)
rename rightsuppin2008_1 rightsuppin2008II
label variable rightsuppin2008II `"Would support right-wing in 2008 = 1, would vote and not support right-wing =0, DK=."'

*PARLIAMENTARY ELECTIONS 2011: who voted for
*Voted for right-wing 2011 = 1, voted and not voted for right-wing=0, refused to answer and DK=.
gen rightvotein2011_1 = ue07
replace rightvotein2011_1="99" if rightvotein2011_1=="NA"
destring rightvotein2011_1, replace
recode rightvotein2011_1 (1=0) (6 7 2 = 1) (-11 -10  88 99 77=.)
recode rightvotein2011_1 (2/89=0)
rename rightvotein2011_1 rightvotein2011II
label variable rightvotein2011II `"Voted for right-wing 2011 = 1, voted and not voted for right-wing=0, refused to answer and DK=."'

*WOULD VOTE FOR IN 2013
*Would support right-wing in 2013 = 1, wouldn vote and not support right-wing =0, DK, Refused=.
gen rightsuppin2013_1 = ue08
recode rightsuppin2013_1 (1=0) (2 6 7 8 = 1) (-11 -10 77 87 88 89 99=.)
recode rightsuppin2013_1 (2/9=0)
rename rightsuppin2013_1 rightsuppin2013II
label variable rightsuppin2013II `"Would support right-wing in 2013 = 1, would vote and not support right-wing =0"'

*PARLIAMENTARY ELECTIONS 2015: who voted for
*Voted for right-wing 2015 = 1, voted and not voted for right-wing=0, DK, Refused=.
gen rightvotein2015_1 = te08
replace rightvotein2015_1="99" if rightvotein2015_1=="NA"
destring rightvotein2015_1, replace
recode rightvotein2015_1 (1=0) (7 3 2 = 1) (-11 97 98 99=.)
recode rightvotein2015_1 (2/9=0)
rename rightvotein2015_1 rightvotein2015II
label variable rightvotein2015II `"Voted for right-wing 2015 = 1, voted and not voted for right-wing=0, DK, Refused=."'

*WOULD VOTE FOR IN 2018
*Would support right-wing in 2018 = 1, wouldn't vote and not support right-wing =0
gen rightsuppin2018II = te09_partia
encode rightsuppin2018II, gen(rightsuppin2018II_1)
gen rightsuppin2018II_2 = rightsuppin2018II_1
recode rightsuppin2018II_2 (1=0) (2 3 6 18 22 24 29 30 34 = 1)
recode rightsuppin2018II_2 (2/34 = 2) (.=0)
gen Ballot2018 = wouldvotein2018
recode Ballot2018 (1 2 3 5=0) (4=3)
drop rightsuppin2018II
gen rightsuppin2018II = Ballot2018 + rightsuppin2018II_2
recode rightsuppin2018II (0=.) (2 3=0)
drop rightsuppin2018II_1 rightsuppin2018II_2 Ballot2018
label variable rightsuppin2018II `"Would support right-wing in 2018 = 1, would vote and not support right-wing =0"'

*********** SWITCHING II *********
gen switch1993_1998II =  rightsuppin1998II if  rightsuppin1993II==0
gen switch1998_2003II =  rightsuppin2003II if  rightsuppin1998II==0
gen switch2003_2008II =  rightsuppin2008II if  rightsuppin2003II==0
gen switch2008_2013II =  rightsuppin2013II if  rightsuppin2008II==0
gen switch2013_2018II =  rightsuppin2018II if  rightsuppin2013II==0

* PO as r-w in 2003
gen switch1998_2003POII =  rightsuppin2003_POII if  rightsuppin1998II==0
gen switch2003PO_2008II =  rightsuppin2008II if  rightsuppin2003_POII==0

******* V ********
*1=right-wing, 0=not voted, not voted for the right

*PARLIAMENTARY ELECTIONS 1991: who voted for
*Voted for right-wing 1991 = 1, not voted and not voted for right-wing=0
gen votedornot1991V=votedornot1991
recode votedornot1991V (0=1)
gen rightvotein1991_1 = yw23 if votedornot1991V== 1
replace rightvotein1991_1="999" if rightvotein1991_1=="NA"
destring rightvotein1991_1, replace
recode rightvotein1991_1 (7 124 134 41 61 46 19 12 13 23 133 42 17 128 = 1) ( 998=.)
recode rightvotein1991_1 (2/999 =0)
gen rightvotein1991V = rightvotein1991_1 
label variable rightvotein1991V `"Voted for right-wing 1991 = 1, not voted and not voted for right-wing=0"'
drop rightvotein1991_1 votedornot1991V

*WOULD VOTE FOR IN 1993
*Would support right-wing in 1993 = 1, would not vote and not support right-wing =0
gen wouldvotein1993V=wouldvotein1993
recode wouldvotein1993V (0=1)
gen rightsuppin1993_1 = yw25  if wouldvotein1993V== 1
replace rightsuppin1993_1="999" if rightsuppin1993_1=="NA"
destring rightsuppin1993_1, replace
recode rightsuppin1993_1 (7 138 41 19 12 13 113 123 23 42 17 128 = 1) (998 = .)
recode rightsuppin1993_1 (2/999=0)
gen rightsuppin1993V = rightsuppin1993_1 
label variable rightsuppin1993V `"Would support right-wing in 1993 = 1, would vote and not support right-wing =0 DK=."'
drop rightsuppin1993_1 wouldvotein1993V

*PARLIAMENTARY ELECTIONS 1993: who voted for
*Voted for right-wing 1993 = 1, not voted and not voted for right-wing=0
gen votedornot1993V=votedornot1993
recode votedornot1993V (0=1)
gen rightvotein1993V_1 = xw10 if votedornot1993V== 1
replace rightvotein1993V_1="999" if rightvotein1993V_1=="NA"
destring rightvotein1993V_1, replace
recode rightvotein1993V_1 (225 41 12 123 111 42 128 = 1) ( 998 =.)
recode rightvotein1993V_1 (2/999 =0)
gen rightvotein1993V = rightvotein1993V_1  
label variable rightvotein1993V `"Voted for right-wing 1993 = 1, not voted and not voted for right-wing=0"'
drop rightvotein1993V_1 votedornot1993V

*PARLIAMENTARY ELECTIONS 1997: who voted for
*Voted for right-wing 1997 = 1, not voted and not voted for right-wing=0
gen votedornot1997V=votedornot1997
recode votedornot1997V (0=1)
gen rightvotein1997V_1 = xw12 if votedornot1997V== 1
replace rightvotein1997V_1="999" if rightvotein1997V_1=="NA"
destring rightvotein1997V_1, replace
recode rightvotein1997V_1 (225 41 12 42 128 = 1) ( 998 =.)
recode rightvotein1997V_1 (2/999=0)
gen rightvotein1997V = rightvotein1997V_1 
label variable rightvotein1997V `"Voted for right-wing 1997 = 1, not voted and not voted for right-wing=0"'
drop rightvotein1997V_1 votedornot1997V

*WOULD VOTE FOR IN 1998
*Would support right-wing in 1998 = 1, would not vote and not support right-wing =0
gen wouldvotein1998V=wouldvotein1998
recode wouldvotein1998V (0=1)
gen rightsuppin1998V_1 = xw14  if wouldvotein1998V== 1
replace rightsuppin1998V_1="999" if rightsuppin1998V_1=="NA"
destring rightsuppin1998V_1, replace
recode rightsuppin1998V_1 (225 7 41 12 123 36 42 128 = 1) ( 998 = .)
recode rightsuppin1998V_1 (2/999=0)
gen rightsuppin1998V = rightsuppin1998V_1 
label variable rightsuppin1998V `"Would support right-wing in 1998 = 1, would not vote and not support right-wing =0"'
drop rightsuppin1998V_1 wouldvotein1998V

*PARLIAMENTARY ELECTIONS 2001: who voted for
*Voted for right-wing 2001 = 1, not voted and not voted for right-wing=0
gen rightvotein2001V_1 = ww10
replace rightvotein2001V_1="99" if rightvotein2001V_1=="NA"
destring rightvotein2001V_1, replace
recode rightvotein2001V_1 (12 14 53 18 22 28 36 40  = 1) (-11  =99) (98 97=98)
recode rightvotein2001V_1 (16/96 .=0)
gen votedornot2001V=votedornot2001
recode votedornot2001V (0=1)
gen rightvotein2001V = rightvotein2001V_1  if votedornot2001V== 1
label variable rightvotein2001V `"Voted for right-wing 2001 = 1, not voted and not voted for right-wing=0"'
recode rightvotein2001V (99=0) (98=.)
drop rightvotein2001V_1 votedornot2001V

*Voted for right-wing 2001 = 1, not voted and not voted for right-wing=0 (*PO = r-W)
gen rightvotein2001V_1 = ww10
replace rightvotein2001V_1="99" if rightvotein2001V_1=="NA"
destring rightvotein2001V_1, replace
recode rightvotein2001V_1 (12 14 53 18 22 28 36 40 20 = 1) (-11  =99) (98 97=98)
recode rightvotein2001V_1 (16/96 .=0)
gen votedornot2001V=votedornot2001
recode votedornot2001V (0=1)
gen rightvotein2001_POV = rightvotein2001V_1  if votedornot2001V== 1
label variable rightvotein2001_POV `"Voted for right-wing 2001 = 1, not voted and not voted for right-wing=0"'
recode rightvotein2001_POV (99=0) (98=.)
drop rightvotein2001V_1 votedornot2001V

*WOULD VOTE FOR IN 2003
*Would support right-wing in 2003 = 1, would not vote and not support right-wing =0
gen rightsuppin2003V_1 = ww14
replace rightsuppin2003V_1="99" if rightsuppin2003V_1=="NA"
destring rightsuppin2003V_1, replace
recode rightsuppin2003V_1 (12 14 53 22 28 36 40 = 1) (-11  99 = 99) (98 97=98)
recode rightsuppin2003V_1 (2/96 .=0)
gen wouldvotein2003V=wouldvotein2003
recode wouldvotein2003V (0=1)
gen rightsuppin2003V = rightsuppin2003V_1  if wouldvotein2003V== 1
label variable rightsuppin2003V `"Would support right-wing in 2003 = 1, would not vote and not support right-wing =0"'
recode rightsuppin2003V (99=0) (98=.)
drop rightsuppin2003V_1 wouldvotein2003V

*Would support right-wing in 2003 = 1, would not vote and not support right-wing =0 (*PO = r-W)
gen rightsuppin2003V_1 = ww14
replace rightsuppin2003V_1="99" if rightsuppin2003V_1=="NA"
destring rightsuppin2003V_1, replace
recode rightsuppin2003V_1 (12 14 53 20 22 28 36 40 = 1) (-11  99 = 99) (98 97=98)
recode rightsuppin2003V_1 (2/96 .=0)
gen wouldvotein2003V=wouldvotein2003
recode wouldvotein2003V (0=1)
gen rightsuppin2003_POV = rightsuppin2003V_1  if wouldvotein2003V== 1
label variable rightsuppin2003_POV `"Would support right-wing in 2003 = 1, would not vote and not support right-wing =0"'
recode rightsuppin2003_POV (99=0) (98=.)
drop rightsuppin2003V_1 wouldvotein2003V

*PARLIAMENTARY ELECTIONS 2005: who voted for
*Voted for right-wing 2005 = 1, not voted and not voted for right-wing=0
gen rightvotein2005V_1 = vw16
replace rightvotein2005V_1="99" if rightvotein2005V_1=="NA"
destring rightvotein2005V_1, replace
recode rightvotein2005V_1 (14 22 28 36 = 1) (-11  =99) (98 97=98)
recode rightvotein2005V_1 (10/96 .=0)
gen votedornot2005V=votedornot2005
recode votedornot2005V (0=1)
gen rightvotein2005V = rightvotein2005V_1  if votedornot2005V== 1
label variable rightvotein2005V `"Voted for right-wing 2005 = 1, not voted and not voted for right-wing=0, refused to answer and DK=."'
recode rightvotein2005V (99=0) (98=.)
drop rightvotein2005V_1 votedornot2005V

*PARLIAMENTARY ELECTIONS 2007: who voted for
*Voted for right-wing 2007 = 1, not voted and not voted for right-wing=0
gen rightvotein2007V_1 = vw18
replace rightvotein2007V_1="99" if rightvotein2007V_1=="NA"
destring rightvotein2007V_1, replace
recode rightvotein2007V_1 (12 14 22 19 28 36 = 1) (-11  =99) (98 =98)
recode rightvotein2007V_1 (2/96 .=0)
gen votedornot2007V=votedornot2007
recode votedornot2007V (0=1)
gen rightvotein2007V = rightvotein2007V_1  if votedornot2007V== 1
label variable rightvotein2007V `"Voted for right-wing 2007 = 1, vnot voted and not voted for right-wing=0, refused to answer and DK=."'
recode rightvotein2007V (99=0) (97 98=.)
drop rightvotein2007V_1 votedornot2007V

*WOULD VOTE FOR IN 2008
*Would support right-wing in 2008 = 1, would not vote and not support right-wing =0
gen rightsuppin2008V_1 = vw19
replace rightsuppin2008V_1="99" if rightsuppin2008V_1=="NA"
destring rightsuppin2008V_1, replace
recode rightsuppin2008V_1 (14 53 22 28 36 = 1) (-11  99 = 99) (98 97=98)
recode rightsuppin2008V_1 (2/96 .=0)
gen wouldvotein2008V=wouldvotein2008
recode wouldvotein2008V (0=1)
gen rightsuppin2008V = rightsuppin2008V_1  if wouldvotein2008V== 1
label variable rightsuppin2008V `"Would support right-wing in 2008 = 1, would not vote and not support right-wing =0"'
recode rightsuppin2008V (99=0) (98 97=.)
drop rightsuppin2008V_1 wouldvotein2008V

*PARLIAMENTARY ELECTIONS 2011: who voted for
*Voted for right-wing 2011 = 1, not voted and not voted for right-wing=0
gen rightvotein2011V_1 = ue07
replace rightvotein2011V_1="96" if rightvotein2011V_1=="NA"
destring rightvotein2011V_1, replace
recode rightvotein2011V_1 (1=0) (6 7 2 = 1) (-11 -10 99 89 88 77 =.) 
recode rightvotein2011V_1 (3/96 =0)
gen votedornot2011V=votedornot2011
recode votedornot2011V (0=1)
gen rightvotein2011V = rightvotein2011V_1  if votedornot2011V== 1
label variable rightvotein2011V `"Voted for right-wing 2011 = 1, not voted and not voted for right-wing=0"'
drop rightvotein2011V_1 votedornot2011V

*WOULD VOTE FOR IN 2013
*Would support right-wing in 2013 = 1, would not vote and not support right-wing =0
gen rightsuppin2013V_1 = ue08
recode rightsuppin2013V_1 (1=0) (2 6 7 8 = 1) (-11 -10 77  88 89 99=.)
recode rightsuppin2013V_1 (2/87=0)
rename rightsuppin2013V_1 rightsuppin2013V
label variable rightsuppin2013V `"Would support right-wing in 2013 = 1, would not vote and not support right-wing =0"'

*PARLIAMENTARY ELECTIONS 2015: who voted for
*Voted for right-wing 2015 = 1, not voted and not voted for right-wing=0
gen rightvotein2015V_1 = te08
replace rightvotein2015V_1="96" if rightvotein2015V_1=="NA"
destring rightvotein2015V_1, replace
recode rightvotein2015V_1 (1=0) (7 3 2 = 1) (-11 97 98 99 =.) 
recode rightvotein2015V_1 (3/96 =0)
gen votedornot2015V=votedornot2015
recode votedornot2015V (0 3=1)
gen rightvotein2015V = rightvotein2015V_1  if votedornot2015V== 1
label variable rightvotein2015V `"Voted for right-wing 2015 = 1, not voted and not voted for right-wing=0"'
drop rightvotein2015V_1 votedornot2015V

*WOULD VOTE FOR IN 2018
*Would support right-wing in 2018 = 1, would not vote and not support right-wing =0
gen rightsuppin2018V = te09_partia
encode rightsuppin2018V, gen(rightsuppin2018V_1)
gen rightsuppin2018V_2 = rightsuppin2018V_1
destring rightsuppin2018V_2, replace
recode rightsuppin2018V_2 (1=.) (2 3 6 18 22 24 29 30 34 = 1)
recode rightsuppin2018V_2 (2/34 = 0) (.=0)
gen Ballot2018 = wouldvotein2018
recode Ballot2018 (1  5=0) (2 3 4=1)
drop rightsuppin2018V
gen rightsuppin2018V = rightsuppin2018V_2 if Ballot2018==1
drop rightsuppin2018V_1 rightsuppin2018V_2 Ballot2018
label variable rightsuppin2018V `"Would support right-wing in 2018 = 1, would not vote and not support right-wing =0"'

******** SWITCHING V ********
gen switch1993_1998V =  rightsuppin1998V if  rightsuppin1993V==0
gen switch1998_2003V =  rightsuppin2003V if  rightsuppin1998V==0
gen switch2003_2008V =  rightsuppin2008V if  rightsuppin2003V==0
gen switch2008_2013V =  rightsuppin2013V if  rightsuppin2008V==0
gen switch2013_2018V =  rightsuppin2018V if  rightsuppin2013V==0

* PO as r-w in 2003
gen switch1998_2003POV =  rightsuppin2003_POV if  rightsuppin1998V==0
gen switch2003PO_2008V =  rightsuppin2008V if  rightsuppin2003_POV==0

******* CATEGORICAL VARIABLE (1=NON-RIGHT, 0=RIGHT-WING, 2=RADICAL RIGHT)

***** II ******
*PARLIAMENTARY ELECTIONS 1991: who voted for
*Voted for rr 1991=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein1991_1 = yw23
replace rightvotein1991_1="999" if rightvotein1991_1=="NA"
destring rightvotein1991_1, replace
recode rightvotein1991_1 (7 124 134  61 46  12 13  133 42  = 240) (17 41 19 23 128=241) (-11 998 999=.)
recode rightvotein1991_1 (2/239=0)
recode rightvotein1991_1 (240=0) (241=2) (0=1)
rename rightvotein1991_1 cat_rightvotein1991II
label variable cat_rightvotein1991II `"Voted for rr 1991=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*WOULD VOTE FOR IN 1993
*Would support rr 1993=2, Would support r-w=0, would vote and not support r-w=1 DK=.
gen rightsuppin1993_1 = yw25
replace rightsuppin1993_1="999" if rightsuppin1993_1=="NA"
destring rightsuppin1993_1, replace
recode rightsuppin1993_1 (7 138 12 13 113 123 42 = 240) (17 41 19 23 128=241) (-11 998 999=.)
recode rightsuppin1993_1 (2/239=0)
recode rightsuppin1993_1 (240=0) (241=2) (0=1)
rename rightsuppin1993_1 cat_rightsuppin1993II
label variable cat_rightsuppin1993II `"Would support rr 1993=2, Would support r-w=0, would vote and not support r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 1993: who voted for
*Voted for rr 1993=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein1993_1 = xw10
replace rightvotein1993_1="999" if rightvotein1993_1=="NA"
destring rightvotein1993_1, replace
recode rightvotein1993_1 (225  12 123 111 42 = 230) (41 128=231) (-11 998 999=.)
recode rightvotein1993_1 (2/229=0)
recode rightvotein1993_1 (230=0) (231=2) (0=1) (239=1)
rename rightvotein1993_1 cat_rightvotein1993II
label variable cat_rightvotein1993II `"Voted for rr 1993=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 1997: who voted for
*Voted for rr 1997=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein1997_1 = xw12
replace rightvotein1997_1="999" if rightvotein1997_1=="NA"
destring rightvotein1997_1, replace
recode rightvotein1997_1 (225 12 42 = 240) (41 128=241) (-11 998 999=.)
recode rightvotein1997_1 (2/239=0)
recode rightvotein1997_1 (240=0) (241=2) (0=1)
rename rightvotein1997_1 cat_rightvotein1997II
label variable cat_rightvotein1997II `"Voted for rr 1997=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*WOULD VOTE FOR IN 1998
*Would support rr 1998=2, Would support r-w=0, would vote and not support r-w=1 DK=.
gen rightsuppin1998_1 = xw14
replace rightsuppin1998_1="999" if rightsuppin1998_1=="NA"
destring rightsuppin1998_1, replace
recode rightsuppin1998_1 (225 7 12 123 36 42 = 230) (41 128=231) (-11 998 999=.)
recode rightsuppin1998_1 (2/229=0)
recode rightsuppin1998_1 (230=0) (231=2) (0=1)
rename rightsuppin1998_1 cat_rightsuppin1998II
label variable cat_rightsuppin1998II `"Would support rr 1998=2, Would support r-w=0, would vote and not support r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 2001: who voted for
*Voted for rr 2001=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein2001_1 = ww10
replace rightvotein2001_1="99" if rightvotein2001_1=="NA"
destring rightvotein2001_1, replace
recode rightvotein2001_1 (12  53 18 22 28 36  = 101) (14 40=102) (-11 98 97 99=.)
recode rightvotein2001_1 (2/96=0)
recode rightvotein2001_1 (101=0) (102=2) (0=1)
rename rightvotein2001_1 cat_rightvotein2001II
label variable cat_rightvotein2001II `"Voted for rr 2001=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*Voted for rr 2001=2, Voted for r-w=0, voted and not voted for r-w=1 DK=. (*PO = r-W)
gen rightvotein2001_1 = ww10
replace rightvotein2001_1="99" if rightvotein2001_1=="NA"
destring rightvotein2001_1, replace
recode rightvotein2001_1 (12  53 18 22 28 36  20 = 101) (14 40=102) (-11 98 97 99=.)
recode rightvotein2001_1 (2/96=0)
recode rightvotein2001_1 (101=0) (102=2) (0=1)
rename rightvotein2001_1 cat_rightvotein2001_POII
label variable cat_rightvotein2001_POII `"Voted for rr 2001=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*WOULD VOTE FOR IN 2003
*Would support rr 2003=2, Would support r-w=0, would vote and not support r-w=1 DK=.
gen rightsuppin2003_1 = ww14
replace rightsuppin2003_1="99" if rightsuppin2003_1=="NA"
destring rightsuppin2003_1, replace
recode rightsuppin2003_1 (12  53 22 28 36  = 101) (14 40=102) (-11 98 97 99=.)
recode rightsuppin2003_1 (2/96=0)
recode rightsuppin2003_1 (101=0) (102=2) (0=1)
rename rightsuppin2003_1 cat_rightsuppin2003II
label variable cat_rightsuppin2003II `"Would support rr 2003=2, Would support r-w=0, would vote and not support r-w=1 DK=."'

*Would support rr 2003=2, Would support r-w=0, would vote and not support r-w=1 DK=. (*PO = r-W)
gen rightsuppin2003_1 = ww14
replace rightsuppin2003_1="99" if rightsuppin2003_1=="NA"
destring rightsuppin2003_1, replace
recode rightsuppin2003_1 (12  53 20 22 28 36  = 101) (14 40=102) (-11 98 97 99=.)
recode rightsuppin2003_1 (2/96=0)
recode rightsuppin2003_1 (101=0) (102=2) (0=1)
rename rightsuppin2003_1 cat_rightsuppin2003_POII
label variable cat_rightsuppin2003_POII `"Would support rr 2003=2, Would support r-w=0, would vote and not support r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 2005: who voted for
*Voted for rr 2005=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein2005_1 = vw16
replace rightvotein2005_1="99" if rightvotein2005_1=="NA"
destring rightvotein2005_1, replace
recode rightvotein2005_1 ( 22 28 36 = 61) (14=62) (-11 98 97 99=.)
recode rightvotein2005_1 (2/52=0)
recode rightvotein2005_1 (61=0) (62=2) (0=1)
rename rightvotein2005_1 cat_rightvotein2005II
label variable cat_rightvotein2005II `"Voted for rr 2005=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 2007: who voted for
*Voted for rr 2007=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein2007_1 = vw18
replace rightvotein2007_1="99" if rightvotein2007_1=="NA"
destring rightvotein2007_1, replace
recode rightvotein2007_1 (12  22  28  = 101) (14 19 36=102) (-11 98 97 99=.)
recode rightvotein2007_1 (2/96=0)
recode rightvotein2007_1 (101=0) (102=2) (0=1)
rename rightvotein2007_1 cat_rightvotein2007II
label variable cat_rightvotein2007II `"Voted for rr 2007=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*WOULD VOTE FOR IN 2008
*Would support rr 2008=2, Would support r-w=0, would vote and not support r-w=1 DK=.
gen rightsuppin2008_1 = vw19
replace rightsuppin2008_1="99" if rightsuppin2008_1=="NA"
destring rightsuppin2008_1, replace
recode rightsuppin2008_1 ( 53 28  = 101) (14 22 36=102) (-11 98 97 99=.)
recode rightsuppin2008_1 (2/96=0)
recode rightsuppin2008_1 (101=0) (102=2) (0=1)
rename rightsuppin2008_1 cat_rightsuppin2008II
label variable cat_rightsuppin2008II `"Would support rr 2008=2, Would support r-w=0, would vote and not support r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 2011: who voted for
*Voted for rr 2011=2, Voted for r-w=0, voted and not voted for r-w=1 DK=.
gen rightvotein2011_1 = ue07
replace rightvotein2011_1="99" if rightvotein2011_1=="NA"
destring rightvotein2011_1, replace
recode rightvotein2011_1 (1=0) ( 7 = 101) (2 6=102) (-11 -10  88 99 77=.)
recode rightvotein2011_1 (2/89=0)
recode rightvotein2011_1 (102=2) (101=0) (0=1)
rename rightvotein2011_1 cat_rightvotein2011II
label variable cat_rightvotein2011II `"Voted for rr 2011=2, Voted for r-w=0, voted and not voted for r-w=1 DK=."'

*WOULD VOTE FOR IN 2013
*Would support rr 2013=2, Would support r-w=0, would vote and not support r-w=1 DK=., Refused=.
gen rightsuppin2013_1 = ue08
recode rightsuppin2013_1 (1=0) ( 7 = 101) (2 6 8=102) (-11 -10 77 87 88 89 99=.)
recode rightsuppin2013_1 (2/9=0)
recode rightsuppin2013_1 (102=2) (101=0) (0=1)
rename rightsuppin2013_1 cat_rightsuppin2013II
label variable cat_rightsuppin2013II `"Would support rr 2013=2, Would support r-w=0, would vote and not support r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 2015: who voted for
*Voted for rr 2015=2, Voted for r-w=0, voted and not voted for r-w=1, DK=., Refused=.
gen rightvotein2015_1 = te08
replace rightvotein2015_1="99" if rightvotein2015_1=="NA"
destring rightvotein2015_1, replace
recode rightvotein2015_1 (1=0)  (7 3 2=102) (-11 97 98 99=.)
recode rightvotein2015_1 (2/9=0)
recode rightvotein2015_1  (102=2) (0=1)
rename rightvotein2015_1 cat_rightvotein2015II
label variable cat_rightvotein2015II `"Voted for rr 2015=2, Voted for r-w=0, voted and not voted for r-w=1, DK=., Refused=."'

*WOULD VOTE FOR IN 2018
*Would support rr 2018=2, Would support r-w=0, would vote and not support r-w=1 DK=.
gen cat_rightsuppin2018II = te09_partia
encode cat_rightsuppin2018II, gen(cat_rightsuppin2018II_1)
gen cat_rightsuppin2018II_2 = cat_rightsuppin2018II_1
recode cat_rightsuppin2018II_2 (1=0)  (2 6 3 18 22 24 29 30 34=102)
recode cat_rightsuppin2018II_2 (2/34 = 2) (.=0)
gen Ballot2018 = wouldvotein2018
recode Ballot2018 (1 2 3 5=0) (4=3)
drop cat_rightsuppin2018II
gen cat_rightsuppin2018II = Ballot2018 + cat_rightsuppin2018II_2
recode cat_rightsuppin2018II (0=.) (2 3=0)  (102=2)
recode cat_rightsuppin2018II (0=1) (1=0)
drop cat_rightsuppin2018II_1 cat_rightsuppin2018II_2 Ballot2018
label variable cat_rightsuppin2018II `"Would support rr 2018=2, Would support r-w=0, would vote and not support r-w=1 DK=."'


******* V ********
*1=right-wing, 0=not voted, not voted for the right

*PARLIAMENTARY ELECTIONS 1991: who voted for
*Voted for rr 1991=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen votedornot1991V=votedornot1991
recode votedornot1991V (0=1)
gen rightvotein1991_1 = yw23 if votedornot1991V== 1
replace rightvotein1991_1="999" if rightvotein1991_1=="NA"
destring rightvotein1991_1, replace
recode rightvotein1991_1 (7 124 134  61 46  12 13  133 42  = 240) (17 41 19 23 128=241) ( 998=.)
recode rightvotein1991_1 (2/239 999 =1) (240=0) (241=2)
gen cat_rightvotein1991V = rightvotein1991_1 
label variable cat_rightvotein1991V `"Voted for rr 1991=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
drop rightvotein1991_1 votedornot1991V

*WOULD VOTE FOR IN 1993
*Would support rr in 1993 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=.
gen wouldvotein1993V=wouldvotein1993
recode wouldvotein1993V (0=1)
gen rightsuppin1993_1 = yw25  if wouldvotein1993V== 1
replace rightsuppin1993_1="999" if rightsuppin1993_1=="NA"
destring rightsuppin1993_1, replace
recode rightsuppin1993_1 (7 138 12 13 113 123 42 = 240) (17 41 19 23 128=241) (998 = .)
recode rightsuppin1993_1 (2/239 999=1)
recode rightsuppin1993_1 (240=0) (241=2) (0=1)
gen cat_rightsuppin1993V = rightsuppin1993_1 
label variable cat_rightsuppin1993V `"Would support rr in 1993 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=."'
drop rightsuppin1993_1 wouldvotein1993V

*PARLIAMENTARY ELECTIONS 1993: who voted for
*Voted for rr 1991=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen votedornot1993V=votedornot1993
recode votedornot1993V (0=1)
gen rightvotein1993V_1 = xw10 if votedornot1993V== 1
replace rightvotein1993V_1="999" if rightvotein1993V_1=="NA"
destring rightvotein1993V_1, replace
recode rightvotein1993V_1 (225  12 123 111 42 = 230) (41 128=231) ( 998 =.)
recode rightvotein1993V_1 (2/229 999 =1)
recode rightvotein1993V_1 (230=0) (231=2)  (239=1)
gen cat_rightvotein1993V = rightvotein1993V_1  
label variable cat_rightvotein1993V `"Voted for rr 1993=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
drop rightvotein1993V_1 votedornot1993V

*PARLIAMENTARY ELECTIONS 1997: who voted for
*Voted for right-wing 1997 = 1, not voted and not voted for right-wing=0
gen votedornot1997V=votedornot1997
recode votedornot1997V (0=1)
gen rightvotein1997V_1 = xw12 if votedornot1997V== 1
replace rightvotein1997V_1="999" if rightvotein1997V_1=="NA"
destring rightvotein1997V_1, replace
recode rightvotein1997V_1 (225 12 42 = 240) (41 128=241) ( 998 =.)
recode rightvotein1997V_1 (2/239 999=1)
recode rightvotein1997V_1 (240=0) (241=2)
gen cat_rightvotein1997V = rightvotein1997V_1 
label variable cat_rightvotein1997V `"Voted for rr 1997=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
drop rightvotein1997V_1 votedornot1997V

*WOULD VOTE FOR IN 1998
*Would support rr in 1998 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=.
gen wouldvotein1998V=wouldvotein1998
recode wouldvotein1998V (0=1)
gen rightsuppin1998V_1 = xw14  if wouldvotein1998V== 1
replace rightsuppin1998V_1="999" if rightsuppin1998V_1=="NA"
destring rightsuppin1998V_1, replace
recode rightsuppin1998V_1 (225 7 12 123 36 42 = 230) (41 128=231) ( 998 = .)
recode rightsuppin1998V_1 (2/229 999=1) (230=0) (231=2)
gen cat_rightsuppin1998V = rightsuppin1998V_1 
label variable cat_rightsuppin1998V `"Would support rr in 1998 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=."'
drop rightsuppin1998V_1 wouldvotein1998V

*PARLIAMENTARY ELECTIONS 2001: who voted for
*Voted for rr 2001=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen rightvotein2001V_1 = ww10
replace rightvotein2001V_1="99" if rightvotein2001V_1=="NA"
destring rightvotein2001V_1, replace
recode rightvotein2001V_1 (12  53 18 22 28 36  = 101) (14 40=102) (-11  =99) (98 97=98)
recode rightvotein2001V_1 (16/96 .=1)
recode rightvotein2001V_1 (101=0) (102=2)
gen votedornot2001V=votedornot2001
recode votedornot2001V (0=1)
gen cat_rightvotein2001V = rightvotein2001V_1  if votedornot2001V== 1
label variable cat_rightvotein2001V `"Voted for rr 2001=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
recode cat_rightvotein2001V (99=1) (98=.)
drop rightvotein2001V_1 votedornot2001V

*Voted for rr 2001=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=. (*PO = r-W)
gen rightvotein2001V_1 = ww10
replace rightvotein2001V_1="99" if rightvotein2001V_1=="NA"
destring rightvotein2001V_1, replace
recode rightvotein2001V_1 (12  53 18 22 28 36  20 = 101) (14 40=102) (-11  =99) (98 97=98)
recode rightvotein2001V_1 (16/96 .=1)
recode rightvotein2001V_1 (101=0) (102=2)
gen votedornot2001V=votedornot2001
recode votedornot2001V (0=1)
gen cat_rightvotein2001_POV = rightvotein2001V_1  if votedornot2001V== 1
label variable cat_rightvotein2001_POV `"Voted for rr 2001=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
recode cat_rightvotein2001_POV (99=1) (98=.)
drop rightvotein2001V_1 votedornot2001V

*WOULD VOTE FOR IN 2003
*Would support rr in 2003 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=.
gen rightsuppin2003V_1 = ww14
replace rightsuppin2003V_1="99" if rightsuppin2003V_1=="NA"
destring rightsuppin2003V_1, replace
recode rightsuppin2003V_1 (12  53 22 28 36  = 101) (14 40=102) (-11  99 = 99) (98 97=98)
recode rightsuppin2003V_1 (2/96 .=1)
recode rightsuppin2003V_1 (101=0) (102=2)
gen wouldvotein2003V=wouldvotein2003
recode wouldvotein2003V (0=1)
gen cat_rightsuppin2003V = rightsuppin2003V_1  if wouldvotein2003V== 1
label variable cat_rightsuppin2003V `"Would support rr in 2003 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=."'
recode cat_rightsuppin2003V (99=1) (98=.)
drop rightsuppin2003V_1 wouldvotein2003V

*Would support rr in 2003 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=. (*PO = r-W)
gen rightsuppin2003V_1 = ww14
replace rightsuppin2003V_1="99" if rightsuppin2003V_1=="NA"
destring rightsuppin2003V_1, replace
recode rightsuppin2003V_1 (12  53 20 22 28 36  = 101) (14 40=102) (-11  99 = 99) (98 97=98)
recode rightsuppin2003V_1 (2/96 .=1)
recode rightsuppin2003V_1 (101=0) (102=2)
gen wouldvotein2003V=wouldvotein2003
recode wouldvotein2003V (0=1)
gen cat_rightsuppin2003_POV = rightsuppin2003V_1  if wouldvotein2003V== 1
label variable cat_rightsuppin2003_POV `"Would support rr in 2003 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=."'
recode cat_rightsuppin2003_POV (99=1) (98=.)
drop rightsuppin2003V_1 wouldvotein2003V

*PARLIAMENTARY ELECTIONS 2005: who voted for
*Voted for rr 2005=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen rightvotein2005V_1 = vw16
replace rightvotein2005V_1="99" if rightvotein2005V_1=="NA"
destring rightvotein2005V_1, replace
recode rightvotein2005V_1 ( 22 28 36 = 61) (14=62) (-11  =99) (98 97=98)
recode rightvotein2005V_1 (2/52 .=1)
recode rightvotein2005V_1 (61=0) (62=2)
gen votedornot2005V=votedornot2005
recode votedornot2005V (0=1)
gen cat_rightvotein2005V = rightvotein2005V_1  if votedornot2005V== 1
label variable cat_rightvotein2005V `"Voted for rr 2005=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
recode cat_rightvotein2005V (99=1) (98=.)
drop rightvotein2005V_1 votedornot2005V

*PARLIAMENTARY ELECTIONS 2007: who voted for
*Voted for rr 2007=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen rightvotein2007V_1 = vw18
replace rightvotein2007V_1="99" if rightvotein2007V_1=="NA"
destring rightvotein2007V_1, replace
recode rightvotein2007V_1 (12  22  28  = 101) (14 19 36=102) (-11  =99) (98 =98)
recode rightvotein2007V_1 (2/96 .=1)
recode rightvotein2007V_1 (101=0) (102=2)
gen votedornot2007V=votedornot2007
recode votedornot2007V (0=1)
gen cat_rightvotein2007V = rightvotein2007V_1  if votedornot2007V== 1
label variable cat_rightvotein2007V `"Voted for rr 2007=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
recode cat_rightvotein2007V (99=1) (97 98=.)
drop rightvotein2007V_1 votedornot2007V

*WOULD VOTE FOR IN 2008
*Would support rr in 2008 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=.
gen rightsuppin2008V_1 = vw19
replace rightsuppin2008V_1="99" if rightsuppin2008V_1=="NA"
destring rightsuppin2008V_1, replace
recode rightsuppin2008V_1 ( 53 28  = 101) (14 22 36=102) (-11  99 = 99) (98 97=98)
recode rightsuppin2008V_1 (2/96 .=1)
recode rightsuppin2008V_1 (101=0) (102=2)
gen wouldvotein2008V=wouldvotein2008
recode wouldvotein2008V (0=1)
gen cat_rightsuppin2008V = rightsuppin2008V_1  if wouldvotein2008V== 1
label variable cat_rightsuppin2008V `"Would support rr in 2008=2, would vote for r-w=0, would not vote and not support r-w=1 DK=."'
recode cat_rightsuppin2008V (99=1) (98 97=.)
drop rightsuppin2008V_1 wouldvotein2008V

*PARLIAMENTARY ELECTIONS 2011: who voted for
*Voted for rr 2011=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen rightvotein2011V_1 = ue07
replace rightvotein2011V_1="96" if rightvotein2011V_1=="NA"
destring rightvotein2011V_1, replace
recode rightvotein2011V_1 ( 7 = 101) (2 6=102) (-11 -10 99 89 88 77 =.) 
recode rightvotein2011V_1 (2/96 =1)
recode rightvotein2011V_1 (102=2) (101=0)
gen votedornot2011V=votedornot2011
recode votedornot2011V (0=1)
gen cat_rightvotein2011V = rightvotein2011V_1  if votedornot2011V== 1
label variable cat_rightvotein2011V `"Voted for rr 2011=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
drop rightvotein2011V_1 votedornot2011V

*WOULD VOTE FOR IN 2013
*Would support rr in 2013 = 2, would vote for r-w=0, would not vote and not support r-w =1 DK=.
gen rightsuppin2013V_1 = ue08
recode rightsuppin2013V_1 ( 7 = 101) (2 6 8=102) (-11 -10 77  88 89 99=.)
recode rightsuppin2013V_1 (2/87=1)
recode rightsuppin2013V_1 (102=2) (101=0)
rename rightsuppin2013V_1 cat_rightsuppin2013V
label variable cat_rightsuppin2013V `"Would support rr in 2013=2, would vote for r-w=0, would not vote and not support r-w=1 DK=."'

*PARLIAMENTARY ELECTIONS 2015: who voted for
*Voted for rr 2015=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=.
gen rightvotein2015V_1 = te08
replace rightvotein2015V_1="96" if rightvotein2015V_1=="NA"
destring rightvotein2015V_1, replace
recode rightvotein2015V_1   (7 2 3=102) (-11 97 98 99 =.) 
recode rightvotein2015V_1 (3/96 =1)
recode rightvotein2015V_1 (101=0) (102=2)
gen votedornot2015V=votedornot2015
recode votedornot2015V (0 3=1)
gen cat_rightvotein2015V = rightvotein2015V_1  if votedornot2015V== 1
label variable cat_rightvotein2015V `"Voted for rr 2015=2, Voted for r-w=0, not voted and not voted for right-wing=1 DK=."'
drop rightvotein2015V_1 votedornot2015V

*WOULD VOTE FOR IN 2018
*Would support rr in 2018=2, would vote for r-w=0, would not vote and not support r-w=1 DK=.
gen cat_rightsuppin2018V = te09_partia
encode cat_rightsuppin2018V, gen(cat_rightsuppin2018V_1)
gen cat_rightsuppin2018V_2 = cat_rightsuppin2018V_1
destring cat_rightsuppin2018V_2, replace
recode cat_rightsuppin2018V_2 (1=.) (2 6 3 18 22 24 29 30 34=102)
recode cat_rightsuppin2018V_2  (2/34 = 1) (.=1)
gen Ballot2018 = wouldvotein2018
recode Ballot2018 (1  5=0) (2 3 4=1)
drop cat_rightsuppin2018V
gen cat_rightsuppin2018V = cat_rightsuppin2018V_2 if Ballot2018==1
recode cat_rightsuppin2018V (101=0) (102=2)
drop cat_rightsuppin2018V_1 cat_rightsuppin2018V_2 Ballot2018
label variable cat_rightsuppin2018V `"Would support rr in 2018=2, would vote for r-w=0, would not vote and not support r-w=1 DK=."'

* SOCIAL-DEMOCRATIC PARTIES
******* V ********
*1=soc-dem, 0=not voted, not voted for the soc-dem

*WOULD VOTE FOR IN 1993
*Would support soc-dem in 1993 = 1, would not vote and not support soc-dem =0
gen wouldvotein1993V=wouldvotein1993
recode wouldvotein1993V (0=1)
gen socsuppin1993_1 = yw25  if wouldvotein1993V== 1
replace socsuppin1993_1="999" if socsuppin1993_1=="NA"
destring socsuppin1993_1, replace
recode socsuppin1993_1 (3 60 104 117 130 = 1) (998 = .)
recode socsuppin1993_1 (2/999=0)
gen socsuppin1993V = socsuppin1993_1 
label variable socsuppin1993V `"Would support soc-dem in 1993=1, would vote and not support soc-dem=0 DK=."'
drop socsuppin1993_1 wouldvotein1993V

*WOULD VOTE FOR IN 1998
*Would support soc-dem in 1998 = 1, would not vote and not support soc-dem =0
gen wouldvotein1998V=wouldvotein1998
recode wouldvotein1998V (0=1)
gen socsuppin1998V_1 = xw14  if wouldvotein1998V== 1
replace socsuppin1998V_1="999" if socsuppin1998V_1=="NA"
destring socsuppin1998V_1, replace
recode socsuppin1998V_1 (60	104	117 = 1) ( 998 = .)
recode socsuppin1998V_1 (2/999=0)
gen socsuppin1998V = socsuppin1998V_1 
label variable socsuppin1998V `"Would support soc-dem in 1998=1, would not vote and not support soc-dem=0"'
drop socsuppin1998V_1 wouldvotein1998V

*WOULD VOTE FOR IN 2003
*Would support soc-dem in 2003 = 1, would not vote and not support soc-dem =0
gen socsuppin2003V_1 = ww14
replace socsuppin2003V_1="99" if socsuppin2003V_1=="NA"
destring socsuppin2003V_1, replace
recode socsuppin2003V_1 (30	34 51 = 1) (-11  99 = 99) (98 97=98)
recode socsuppin2003V_1 (2/96 .=0)
gen wouldvotein2003V=wouldvotein2003
recode wouldvotein2003V (0=1)
gen socsuppin2003V = socsuppin2003V_1  if wouldvotein2003V== 1
label variable socsuppin2003V `"Would support soc-dem in 2003=1, would not vote and not support soc-dem=0"'
recode socsuppin2003V (99=0) (98=.)
drop socsuppin2003V_1 wouldvotein2003V

*WOULD VOTE FOR IN 2008
*Would support soc-dem in 2008 = 1, would not vote and not support soc-dem =0
gen socsuppin2008V_1 = vw19
replace socsuppin2008V_1="99" if socsuppin2008V_1=="NA"
destring socsuppin2008V_1, replace
recode socsuppin2008V_1 (13 15 30 33 51 = 1) (-11  99 = 99) (98 97=98)
recode socsuppin2008V_1 (2/96 .=0)
gen wouldvotein2008V=wouldvotein2008
recode wouldvotein2008V (0=1)
gen socsuppin2008V = socsuppin2008V_1  if wouldvotein2008V== 1
label variable socsuppin2008V `"Would support soc-dem in 2008=1, would not vote and not support soc-dem=0"'
recode socsuppin2008V (99=0) (98 97=.)
drop socsuppin2008V_1 wouldvotein2008V

*WOULD VOTE FOR IN 2013
*Would support soc-dem in 2013 = 1, would not vote and not support soc-dem =0
gen socsuppin2013V_1 = ue08
recode socsuppin2013V_1 (1=0) (5 = 1) (-11 -10 77 88 89 99=.)
recode socsuppin2013V_1 (2/87=0)
rename socsuppin2013V_1 socsuppin2013V
label variable socsuppin2013V `"Would support soc-dem in 2013=1, would not vote and not support soc-dem=0"'

*WOULD VOTE FOR IN 2018
*Would support soc-dem in 2018 = 1, would not vote and not support soc-dem =0
gen socsuppin2018V = te09_partia
encode socsuppin2018V, gen(socsuppin2018V_1)
gen socsuppin2018V_2 = socsuppin2018V_1
destring socsuppin2018V_2, replace
recode socsuppin2018V_2 (1=.) (7 16 23 25 27 28 33 31= 1) 
recode socsuppin2018V_2 (2/34 = 0) (.=0)
gen Ballot2018 = wouldvotein2018
recode Ballot2018 (1 5=0) (2 3 4=1)
drop socsuppin2018V
gen socsuppin2018V = socsuppin2018V_2 if Ballot2018==1
drop socsuppin2018V_1 socsuppin2018V_2 Ballot2018
label variable socsuppin2018V `"Would support soc-dem in 2018=1, would not vote and not support soc-dem=0"'

******** SWITCHING V ********
gen switchsoc1993_1998V =  rightsuppin1998V if  rightsuppin1993V==0 & socsuppin1993V==1
gen switchsoc1998_2003V =  rightsuppin2003V if  rightsuppin1998V==0 & socsuppin1998V==1
gen switchsoc2003_2008V =  rightsuppin2008V if  rightsuppin2003V==0 & socsuppin2003V==1
gen switchsoc2008_2013V =  rightsuppin2013V if  rightsuppin2008V==0 & socsuppin2008V==1
gen switchsoc2013_2018V =  rightsuppin2018V if  rightsuppin2013V==0 & socsuppin2013V==1

* PO as r-w in 2003
gen switchsoc1998_2003POV =  rightsuppin2003_POV if  rightsuppin1998V==0 & socsuppin1998V==1
gen switchsoc2003PO_2008V =  rightsuppin2008V if  rightsuppin2003_POV==0 & socsuppin2003V==1

******* II ********
*1=soc-dem, 0=not support soc-dem

*WOULD VOTE FOR IN 1993
*Would support soc-dem in 1993 = 1, would vote and not support soc-dem =0 DK=.
gen socsuppin1993_1 = yw25
replace socsuppin1993_1="999" if socsuppin1993_1=="NA"
destring socsuppin1993_1, replace
recode socsuppin1993_1 (3 60 104 117 130 = 1) (-11 998 999=.)
recode socsuppin1993_1 (2/239=0)
rename socsuppin1993_1 socsuppin1993II
label variable socsuppin1993II `"Would support soc-dem in 1993 = 1, would vote and not support soc-dem =0 DK=."'

*WOULD VOTE FOR IN 1998
*Would support soc-dem in 1998 = 1, would vote and not support soc-dem =0, DK=.
gen socsuppin1998_1 = xw14
replace socsuppin1998_1="999" if socsuppin1998_1=="NA"
destring socsuppin1998_1, replace
recode socsuppin1998_1 (60	104	117 = 1) (-11 998 999=.)
recode socsuppin1998_1 (2/229=0)
rename socsuppin1998_1 socsuppin1998II
label variable socsuppin1998II `"Would support soc-dem in 1998 = 1, would vote and not support soc-dem =0, DK=."'

*WOULD VOTE FOR IN 2003
*Would support soc-dem in 2003 = 1, would vote and not support soc-dem =0, refused to answer and DK=.
gen socsuppin2003_1 = ww14
replace socsuppin2003_1="99" if socsuppin2003_1=="NA"
destring socsuppin2003_1, replace
recode socsuppin2003_1 (30	34 51 = 1) (-11 98 97 99=.)
recode socsuppin2003_1 (2/96=0)
rename socsuppin2003_1 socsuppin2003II
label variable socsuppin2003II `"Would support soc-dem in 2003 = 1, would vote and not support soc-dem =0, refused to answer and DK=."'

*WOULD VOTE FOR IN 2008
*Would support soc-dem in 2008 = 1, would vote and not support soc-dem =0, DK=.
gen socsuppin2008_1 = vw19
replace socsuppin2008_1="99" if socsuppin2008_1=="NA"
destring socsuppin2008_1, replace
recode socsuppin2008_1 (13 15 30 33 51 = 1) (-11 98 97 99=.)
recode socsuppin2008_1 (2/96=0)
rename socsuppin2008_1 socsuppin2008II
label variable socsuppin2008II `"Would support soc-dem in 2008 = 1, would vote and not support soc-dem=0, DK=."'

*WOULD VOTE FOR IN 2013
*Would support soc-dem in 2013 = 1, wouldn vote and not support soc-dem =0, DK, Refused=.
gen socsuppin2013_1 = ue08
recode socsuppin2013_1 (1=0) (5 = 1) (-11 -10 77 87 88 89 99=.)
recode socsuppin2013_1 (2/9=0)
rename socsuppin2013_1 socsuppin2013II
label variable socsuppin2013II `"Would support soc-dem in 2013 = 1, would vote and not support soc-dem =0"'

*WOULD VOTE FOR IN 2018
*Would support soc-dem in 2018 = 1, wouldn't vote and not support soc-dem =0
gen socsuppin2018II = te09_partia
encode socsuppin2018II, gen(socsuppin2018II_1)
gen socsuppin2018II_2 = socsuppin2018II_1
recode socsuppin2018II_2 (1=0) (7 16 23 25 27 28 33 31 = 1)
recode socsuppin2018II_2 (2/34 = 2) (.=0)
gen Ballot2018 = wouldvotein2018
recode Ballot2018 (1 2 3 5=0) (4=3)
drop socsuppin2018II
gen socsuppin2018II = Ballot2018 + socsuppin2018II_2
recode socsuppin2018II (0=.) (2 3=0)
drop socsuppin2018II_1 socsuppin2018II_2 Ballot2018
label variable socsuppin2018II `"Would support soc-dem in 2018 = 1, would vote and not support soc-dem =0"'

*********** SWITCHING II *********
gen switchsoc1993_1998II =  rightsuppin1998II if  rightsuppin1993II==0 & socsuppin1993II==1
gen switchsoc1998_2003II =  rightsuppin2003II if  rightsuppin1998II==0 & socsuppin1998II==1
gen switchsoc2003_2008II =  rightsuppin2008II if  rightsuppin2003II==0 & socsuppin2003II==1
gen switchsoc2008_2013II =  rightsuppin2013II if  rightsuppin2008II==0 & socsuppin2008II==1
gen switchsoc2013_2018II =  rightsuppin2018II if  rightsuppin2013II==0 & socsuppin2013II==1

* PO as r-w in 2003
gen switchsoc1998_2003POII =  rightsuppin2003_POII if  rightsuppin1998II==0 & socsuppin1998II==1
gen switchsoc2003PO_2008II =  rightsuppin2008II if  rightsuppin2003_POII==0 & socsuppin2003II==1

